/* ============================================
   AG Configurator — Ampera Group Design System
   Glassmorphism | Unbounded + Inter | Ampera Red
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@200;300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

/* ═══════ Light Theme (единственная тема) ═══════ */
:root {
    /* Brand */
    --ampera-red: #E31E24;
    --ampera-red-dark: #B91820;
    --ampera-red-light: #FF6B6B;
    --gradient-red: linear-gradient(135deg, #E31E24, #FF6B6B);

    /* Backgrounds */
    --bg-primary: #FAFBFF;
    --bg-secondary: #F0F2F8;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input-solid: #FFFFFF;

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-blur: 20px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);

    /* Borders */
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);

    /* Text */
    --text-primary: #1A1A2E;
    --text-secondary: #6B7280;
    --text-dim: #9CA3AF;

    /* Accent */
    --accent: #E31E24;
    --accent-light: #FF6B6B;
    --active-color: #E31E24;
    --accent-glow: rgba(227, 30, 36, 0.1);
    --accent-soft: rgba(227, 30, 36, 0.04);

    /* Code */
    --code-bg: #1A1A2E;
    --code-color: #FF8A8A;

    /* Table */
    --table-border: rgba(0, 0, 0, 0.05);

    /* Shadows */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.08);

    /* Buttons */
    --btn-gradient: linear-gradient(135deg, #E31E24, #FF6B6B);
    --btn-hover: linear-gradient(135deg, #FF4444, #FF8888);
    --btn-shadow: 0 4px 16px rgba(227, 30, 36, 0.25);
    --btn-shadow-hover: 0 8px 24px rgba(227, 30, 36, 0.35);

    /* Layout */
    --summary-bg: linear-gradient(180deg, rgba(240, 242, 248, 0.95) 0%, rgba(250, 251, 255, 1) 100%);
    --header-bg: rgba(255, 255, 255, 0.85);
    --select-color: #1A1A2E;

    /* System */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --radius-pill: 100px;
    --font-display: 'Unbounded', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --backdrop: blur(20px) saturate(180%);
    --dot-color: rgba(227, 30, 36, 0.03);
}

/* ═══════ Reset ═══════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ═══════ Body ═══════ */
body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
    background-size: 28px 28px;
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    transition: background-color var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════ Header ═══════ */
.header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    z-index: 100;
    transition: background var(--transition), border-color var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo-img {
    height: 28px;
    opacity: 0.95;
    transition: opacity var(--transition);
}

.header-logo-img:hover {
    opacity: 1;
}

.header-title h1 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-family: var(--font-display);
    font-size: 0.55rem;
    color: var(--ampera-red);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}




/* ═══════ Main Layout ═══════ */
.main {
    height: calc(100vh - 60px);
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

/* ═══════ Left: Configurator Steps ═══════ */
#configuratorSteps {
    height: 100%;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

#configuratorSteps::-webkit-scrollbar {
    width: 4px;
}

#configuratorSteps::-webkit-scrollbar-track {
    background: transparent;
}

#configuratorSteps::-webkit-scrollbar-thumb {
    background: rgba(227, 30, 36, 0.2);
    border-radius: 4px;
}

#configuratorSteps::-webkit-scrollbar-thumb:hover {
    background: rgba(227, 30, 36, 0.4);
}

/* ═══════ Right: Summary Panel ═══════ */
#summaryPanel {
    height: 100%;
    overflow-y: auto;
    border-left: 1px solid var(--border);
    background: var(--summary-bg);
    transition: background var(--transition), border-color var(--transition);
}

#summaryPanel::-webkit-scrollbar {
    width: 4px;
}

#summaryPanel::-webkit-scrollbar-track {
    background: transparent;
}

#summaryPanel::-webkit-scrollbar-thumb {
    background: rgba(227, 30, 36, 0.2);
    border-radius: 4px;
}

.summary-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.summary-card .card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--accent-soft);
}

.summary-card .card-header h2 {
    font-family: var(--font-display) !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--active-color);
}

.summary-card .card-body {
    padding: 1.25rem 1.5rem 2rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Station Preview Image */
.summary-card img {
    max-height: 220px;
    width: auto !important;
    margin: 0.75rem auto 1.25rem auto;
    object-fit: contain;
    background: transparent;
    border-radius: var(--radius);
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
    transition: transform 0.6s var(--ease-out-expo), filter 0.6s var(--ease-out-expo);
}

.summary-card img:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 12px 32px rgba(227, 30, 36, 0.12));
}

/* ═══════ Cards — Glassmorphism ═══════ */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: all 0.4s var(--ease-out-expo);
}

.card:hover {
    border-color: rgba(227, 30, 36, 0.15);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

.card-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-header h2 {
    font-family: var(--font-display) !important;
    font-size: 0.8rem !important;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-icon {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.card-body {
    padding: 0.5rem 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* ═══════ Readonly Auto Steps ═══════ */
.readonly-step {
    transition: all var(--transition);
}

.compact-step {
    background: var(--accent-soft);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.compact-step:hover {
    border-color: rgba(227, 30, 36, 0.1);
    background: var(--accent-glow);
}

/* ═══════ Form Elements ═══════ */
.form-group {
    margin-bottom: 0.5rem;
}

label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

select,
input {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    background: var(--bg-input-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--select-color);
    width: 100%;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
}

select option {
    background: var(--bg-primary);
    color: var(--select-color);
    padding: 8px;
}

select:hover,
input:hover {
    border-color: var(--border-hover);
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ═══════ Codes Block ═══════ */
.codes-block {
    margin-bottom: 1rem;
}

.codes-block label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.code-display {
    padding: 0.6rem 0.85rem;
    font-size: 0.8rem;
    margin: 0 0 0.75rem 0;
    font-family: var(--font-mono);
    background: var(--code-bg);
    color: var(--code-color);
    border-radius: var(--radius-sm);
    word-break: break-all;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background var(--transition), color var(--transition);
    border: 1px solid var(--border);
}

/* ═══════ Specs Table ═══════ */
#summarySpecs {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-grow: 1;
    overflow: hidden;
    max-height: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.specs-table {
    width: 100%;
    font-size: 0.82rem;
    border-collapse: collapse;
}

.specs-table thead th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--active-color);
    padding: 8px 10px 10px;
    border-bottom: 2px solid var(--accent) !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.specs-table td {
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    transition: background var(--transition);
    vertical-align: middle;
}

.specs-table tbody tr {
    transition: background var(--transition);
}

.specs-table tbody tr:hover {
    background: var(--accent-soft);
}

.specs-table tbody tr:last-child td {
    border-bottom: none;
}

.spec-group-header {
    background: #f8fafc;
}

.spec-group-header td {
    font-size: 0.78rem;
    padding: 5px 10px;
}

.spec-group-value td {
    font-size: 0.78rem;
    padding: 4px 10px 6px;
}

.tc-breakdown-code {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--active-color);
    white-space: nowrap;
    font-size: 0.8rem;
}

/* ═══════ Buttons — Ampera Style ═══════ */
.btn-primary {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: var(--btn-gradient);
    border: none;
    border-radius: var(--radius-pill);
    color: white;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: auto;
    letter-spacing: -0.01em;
    transition: all 0.4s var(--ease-out-expo);
    box-shadow: var(--btn-shadow);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-primary:hover {
    background: var(--btn-hover);
    box-shadow: var(--btn-shadow-hover);
    transform: translateY(-2px);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(227, 30, 36, 0.3);
}

/* ═══════ Animations ═══════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: var(--btn-shadow); }
    50% { box-shadow: 0 4px 24px rgba(227, 30, 36, 0.5); }
}

.animate-card {
    animation: fadeInUp 0.6s var(--ease-out-expo) both;
}

/* ═══════ Utilities ═══════ */
.mt-2 {
    margin-top: 0.3rem !important;
}

/* ═══════ Scrollbar — Global ═══════ */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(227, 30, 36, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(227, 30, 36, 0.3);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(227, 30, 36, 0.12);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(227, 30, 36, 0.25);
}

/* ═══════ Mobile Responsiveness ═══════ */
@media (max-width: 992px) {
    body {
        overflow: auto;
        height: auto;
    }

    .main {
        height: auto;
        overflow: visible;
        padding: 0.75rem;
    }

    .two-col-layout {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        height: auto;
    }

    #summaryPanel {
        order: 1;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: var(--radius);
    }

    .summary-card {
        height: auto;
    }

    .summary-card img {
        max-height: 250px;
    }

    .header {
        height: 56px;
        padding: 0 1rem;
    }
}

@media (max-width: 600px) {
    .header-title h1 {
        font-size: 0.8rem;
    }

    .header-subtitle {
        font-size: 0.5rem;
    }

    .btn-primary {
        font-size: 0.8rem;
        padding: 0.75rem 1.25rem;
    }
}

/* ═══════ Email Modal Overlay ═══════ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-input-solid);
    padding: 24px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-elevated);
    animation: fadeInUp 0.3s var(--ease-out-expo);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none; border: none; font-size: 1.8rem;
    color: var(--text-secondary); cursor: pointer;
    line-height: 1; margin-top: -8px; 
}
.close-btn:hover { color: var(--ampera-red); }

.modal-body textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    background: var(--bg-input-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--select-color);
    resize: vertical;
    transition: all var(--transition);
}
.modal-body textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}