* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --text: #17221e;
    --text-secondary: #68766f;
    --border: #d6e2dd;
    --surface: #ffffff;
    --surface-soft: #f1f8f5;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --success: #065f46;
    --success-bg: #ecfdf5;
    --warning: #92400e;
    --warning-bg: #fffbeb;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(16, 185, 129, 0.09),
            transparent 35%
        ),
        linear-gradient(145deg, #ffffff 0%, #f1f8f5 100%);
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(16, 185, 129, 0.3);
    outline-offset: 3px;
}

.container {
    width: 100%;
    max-width: 580px;
    margin: auto;
}

/* ======================================
   BRAND HEADER
====================================== */

.brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    color: #ffffff;
    background: linear-gradient(145deg, #10b981, #047857);
    box-shadow: 0 7px 18px rgba(5, 150, 105, 0.2);
    font-size: 25px;
    font-weight: 700;
}

.brand .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.brand-name {
    color: rgb(14, 59, 43);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.brand-caption {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

.secure-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.8);
    color: #52635a;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.secure-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* ======================================
   MAIN CARD
====================================== */

.card {
    position: relative;
    overflow: hidden;
    padding: 34px;
    border: 1px solid rgba(214, 226, 221, 0.95);
    border-radius: 24px;
    background: linear-gradient(145deg, #ffffff 0%, #fbfdfc 100%);
    box-shadow: var(--shadow);
}

.card::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #059669, #34d399);
    content: "";
}

.card-heading {
    margin-bottom: 28px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(25px, 5vw, 31px);
    color: rgb(14, 59, 43);
    line-height: 1.25;
    letter-spacing: -0.8px;
}

.description {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 14px;
}

/* ======================================
   INSTALLATION PROGRESS
====================================== */

.installation-progress {
    margin-bottom: 30px;
    padding: 18px;
    border: 1px solid #e1ebe6;
    border-radius: 16px;
    background: var(--surface-soft);
}

.progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.progress-title {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.progress-caption {
    color: var(--text-secondary);
    font-size: 11px;
    text-align: right;
}

.progress-track {
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 10px;
    background: #dce8e2;
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.35s ease;
}

.step-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #87958d;
    text-align: center;
}

.step-number {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d6e2dd;
    border-radius: 50%;
    background: #ffffff;
    color: #87958d;
    font-size: 12px;
    font-weight: 700;
    transition:
        color 0.2s,
        background 0.2s,
        border-color 0.2s;
}

.step-text {
    font-size: 10px;
    line-height: 1.4;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.step-item.active {
    color: var(--primary-dark);
}

.step-item.active .step-number {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.step-item.completed {
    color: var(--success);
}

.step-item.completed .step-number {
    border-color: #a7f3d0;
    background: #d1fae5;
    color: #065f46;
}

/* ======================================
   FORM
====================================== */

#installer-form {
    margin: 0;
}

.form-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

label {
    display: block;
    margin: 0;
    color: rgb(14, 59, 43);
    font-size: 13px;
    font-weight: 700;
}

.required-label {
    color: var(--text-secondary);
    font-size: 10px;
}

input {
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 13px 15px;
    border: 1px solid #cbd8d2;
    border-radius: 11px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        background 0.2s;
}

input::placeholder {
    color: #9aa69f;
}

input:hover:not(:disabled) {
    border-color: #a7bbb0;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

input:disabled {
    background: #f4f7f5;
    cursor: not-allowed;
}

.field-help {
    margin: 9px 0 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.6;
}

/* ======================================
   BUTTONS
====================================== */

button {
    position: relative;
    width: 100%;
    min-height: 50px;
    margin-top: 20px;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 5px 13px rgba(5, 150, 105, 0.14);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    transition:
        background 0.2s,
        box-shadow 0.2s,
        transform 0.2s,
        opacity 0.2s;
}

button:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.2);
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.65;
    cursor: wait;
    box-shadow: none;
    transform: none;
}

.button-arrow {
    font-size: 18px;
    line-height: 1;
}

.primary-button {
    margin-top: 22px;
}

/* ======================================
   STATUS PANEL
====================================== */

.status-panel {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-top: 24px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #f8fbf9;
}

.status-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #e8f5ee;
    color: var(--primary-dark);
}

.status-icon span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}

.status-content {
    flex: 1;
    min-width: 0;
}

.status-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.status-heading h2 {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 20px;
    background: #e8f5ee;
    color: var(--success);
    font-size: 10px;
    font-weight: 700;
}

.status {
    display: none;
    margin-top: 9px;
    color: #52635a;
    font-size: 12px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.status.visible {
    display: block;
}

.status p {
    margin: 7px 0;
}

.status strong {
    font-weight: 700;
}

.status a {
    display: inline-block;
    margin-top: 7px;
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.status.error {
    color: var(--danger);
}

.status.success {
    color: var(--success);
}

.status-panel:has(.status.error) {
    border-color: #fecaca;
    background: var(--danger-bg);
}

.status-panel:has(.status.error) .status-icon {
    background: #fee2e2;
    color: var(--danger);
}

.status-panel:has(.status.error) .status-badge {
    background: #fee2e2;
    color: var(--danger);
}

.status-panel:has(.status.success) {
    border-color: #a7f3d0;
    background: var(--success-bg);
}

.status-panel:has(.status.success) .status-icon {
    background: #d1fae5;
    color: var(--success);
}

.status-panel:has(.status.success) .status-badge {
    background: #d1fae5;
    color: var(--success);
}

/* ======================================
   NEXT ACTION PANEL
====================================== */

.action-panel {
    margin-top: 16px;
    padding: 19px;
    border: 1px solid #f3d9a5;
    border-radius: 15px;
    background: var(--warning-bg);
}

.action-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.action-indicator {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: #d97706;
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
}

.action-heading h2 {
    margin: 0 0 6px;
    color: #78350f;
    font-size: 13px;
    line-height: 1.5;
}

.action-heading p {
    margin: 0;
    color: #92400e;
    font-size: 12px;
    line-height: 1.7;
}

#installer-action-content {
    margin-top: 15px;
}

#installer-action-content a {
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

#installer-action-content button {
    margin-top: 10px;
}

#installer-action-content button:first-child {
    margin-top: 0;
}

#installer-action-content button.secondary-button {
    border-color: #d6e2dd;
    background: #ffffff;
    color: var(--text);
    box-shadow: none;
}

#installer-action-content button.secondary-button:hover:not(:disabled) {
    border-color: #a7bbb0;
    background: #f8fbf9;
}

/* ======================================
   SECURITY NOTE
====================================== */

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-top: 26px;
    padding: 17px;
    border: 1px solid #dceee5;
    border-radius: 14px;
    background: #f5fbf7;
}

.security-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #dff7e9;
    color: var(--primary-dark);
}

.security-note strong {
    display: block;
    margin-bottom: 6px;
    color: #14532d;
    font-size: 12px;
    line-height: 1.5;
}

.security-note p {
    margin: 0;
    color: #52635a;
    font-size: 11px;
    line-height: 1.8;
}

/* ======================================
   HELP NOTE
====================================== */

.help-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 13px 2px;
}

.help-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #a7bbb0;
    border-radius: 50%;
    color: #52635a;
    font-size: 11px;
    font-weight: 700;
}

.help-note p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.8;
}

/* ======================================
   NAVIGATION & FOOTER
====================================== */

.back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
    padding: 8px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.back:hover {
    color: #065f46;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.back span {
    font-size: 16px;
}

footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 11px;
    text-align: center;
}

.footer-separator {
    color: #a7bbb0;
}

/* ======================================
   RESPONSIVE
====================================== */

@media (max-width: 600px) {
    body {
        align-items: flex-start;
        padding: 22px 14px;
    }

    .container {
        max-width: 460px;
    }

    .brand-header {
        margin-bottom: 18px;
    }

    .card {
        padding: 26px 21px;
        border-radius: 20px;
    }

    .installation-progress {
        padding: 15px 12px;
    }

    .step-list {
        gap: 4px;
    }

    .step-number {
        width: 28px;
        height: 28px;
    }

    .step-text {
        font-size: 9px;
    }

    .status-panel {
        padding: 14px;
    }

    .security-note {
        padding: 14px;
    }
}

@media (max-width: 380px) {
    body {
        padding: 16px 10px;
    }

    .brand-header {
        align-items: flex-start;
    }

    .logo {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 13px;
        font-size: 22px;
    }

    .brand-name {
        font-size: 12px;
    }

    .brand-caption {
        font-size: 9px;
        letter-spacing: 0.8px;
    }

    .secure-label {
        gap: 5px;
        padding: 8px;
        font-size: 10px;
    }

    .card {
        padding: 23px 16px;
    }

    h1 {
        font-size: 25px;
    }

    .progress-caption {
        font-size: 10px;
    }

    .step-text {
        font-size: 8px;
    }

    .status-heading {
        align-items: flex-start;
    }
}

/* ======================================
   REDUCE MOTION
====================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}