:root {
    --bg: #081117;
    --bg-deep: #0c1821;
    --text: #eef5f7;
    --text-soft: #9eb0bc;
    --line: rgba(138, 196, 247, 0.18);
    --line-strong: rgba(160, 214, 255, 0.34);
    --primary: #53b8ff;
    --primary-strong: #84d3ff;
    --highlight: #c5d487;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
    --radius-xl: 28px;
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    position: relative;
    overflow-x: hidden;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(900px 580px at 8% -10%, rgba(83, 184, 255, 0.18), transparent 65%),
        radial-gradient(760px 520px at 95% 8%, rgba(197, 212, 135, 0.10), transparent 68%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

#backgroundCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.85;
    pointer-events: none;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0 40px;
}

.hero-card,
.panel {
    backdrop-filter: blur(12px);
    background: linear-gradient(180deg, rgba(20, 43, 61, 0.8) 0%, rgba(11, 24, 34, 0.88) 100%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-card {
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}

.hero-topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: auto -10% -40% auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(83, 184, 255, 0.18) 0%, transparent 72%);
    pointer-events: none;
}

.brand-row {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.language-toggle {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    flex: 0 0 auto;
}

.lang-button {
    appearance: none;
    border: 0;
    min-width: 54px;
    padding: 10px 14px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-button:hover {
    color: var(--text);
}

.lang-button.is-active {
    background: linear-gradient(135deg, var(--primary), var(--highlight));
    color: #07131b;
    box-shadow: 0 8px 24px rgba(83, 184, 255, 0.18);
}

.brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #07131b;
    background: linear-gradient(135deg, var(--primary-strong), var(--highlight));
    box-shadow: 0 10px 30px rgba(83, 184, 255, 0.26);
}

.brand-copy h1,
.panel-heading h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
}

.brand-copy h1 {
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.02;
}

.eyebrow,
.panel-kicker,
.summary-label {
    margin: 0 0 8px;
    color: var(--text-soft);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.hero-text {
    max-width: 700px;
    margin: 14px 0 0;
    color: var(--text-soft);
    font-size: 1.02rem;
    line-height: 1.6;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.2fr);
    gap: 22px;
}

.panel {
    border-radius: var(--radius-xl);
    padding: 24px;
}

.panel-heading {
    margin-bottom: 20px;
}

.panel-heading h2 {
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
}

.step-card {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 14px;
    align-items: start;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(160, 214, 255, 0.1);
}

.step-index {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(83, 184, 255, 0.18), rgba(83, 184, 255, 0.08));
    color: var(--primary-strong);
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
}

.step-list strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1rem;
}

.step-list p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.installer-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field-grid,
.field-group {
    display: grid;
    gap: 8px;
}

#variantGroup {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.22s ease, max-height 0.22s ease;
}

#variantGroup.is-visible {
    opacity: 1;
    max-height: 160px;
}

label {
    font-weight: 600;
}

select {
    width: 100%;
    min-height: 56px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: rgba(83, 184, 255, 0.08);
    color: var(--text);
    padding: 0 16px;
    font: inherit;
}

select:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(83, 184, 255, 0.12);
}

select option {
    background: #0f1c26;
    color: var(--text);
}

.selection-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-item {
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(83, 184, 255, 0.06));
    border: 1px solid rgba(160, 214, 255, 0.1);
    min-height: 92px;
}

.summary-item strong {
    display: block;
    font-size: 1rem;
    line-height: 1.35;
}

.flash-area {
    margin-top: 4px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(9, 19, 26, 0.8), rgba(9, 19, 26, 0.55));
}

esp-web-install-button {
    display: block;
    border-radius: 16px;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

esp-web-install-button[data-state="disabled"] {
    pointer-events: none;
    opacity: 0.82;
    filter: grayscale(0.35) saturate(0.7);
}

esp-web-install-button::part(button) {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-radius: 16px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--highlight));
    color: #07131b;
    box-shadow: 0 14px 28px rgba(83, 184, 255, 0.2);
}

esp-web-install-button:not([enabled])::part(button) {
    background: linear-gradient(135deg, #74828d, #56626c);
    color: rgba(238, 245, 247, 0.82);
    box-shadow: none;
    opacity: 1;
    pointer-events: none;
    cursor: not-allowed;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-text {
    margin: 14px 0 0;
    min-height: 22px;
    color: var(--text-soft);
    line-height: 1.5;
}

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 8px 4px 0;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.page-footer p {
    margin: 0;
}

@media (max-width: 860px) {
    .page-shell {
        width: min(100vw - 24px, 760px);
        padding-top: 20px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .page-footer {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .hero-card,
    .panel {
        padding: 20px;
        border-radius: 22px;
    }

    .hero-topbar {
        flex-direction: column;
    }

    .brand-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .language-toggle {
        align-self: flex-start;
    }

    .brand-mark {
        width: 60px;
        height: 60px;
        border-radius: 18px;
    }

    .selection-summary,
    .step-card {
        grid-template-columns: 1fr;
    }

    .step-index {
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
