:root {
    --bg: #071421;
    --bg-soft: #0e1f2d;
    --panel: rgba(12, 24, 38, 0.78);
    --panel-light: rgba(18, 33, 50, 0.9);
    --card: #f7f9ff;
    --white: #ffffff;
    --text: #eaf2ff;
    --text-soft: #a4b3c7;
    --muted: #7d90a6;
    --primary: #5eead4;
    --primary-2: #60a5fa;
    --secondary: #8b5cf6;
    --accent: #22c55e;
    --danger: #fb7185;
    --line: rgba(154, 170, 194, 0.2);
    --shadow: 0 30px 80px rgba(15, 23, 42, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(94, 234, 212, 0.18), transparent 24%),
        linear-gradient(150deg, #071421 0%, #0c1d2d 42%, #0b1623 100%);
}

.auth-theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1100;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    color: var(--text);
    background: rgba(10, 20, 32, 0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.auth-theme-toggle:hover {
    color: var(--primary);
    border-color: rgba(94, 234, 212, 0.55);
    transform: translateY(-1px);
}

.auth-theme-toggle:focus-visible {
    outline: 3px solid rgba(94, 234, 212, 0.35);
    outline-offset: 3px;
}

html[data-theme="light"] .auth-theme-toggle,
html[data-theme="system"] .auth-theme-toggle {
    color: #172033;
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(15, 23, 42, 0.16);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 64px;
}

.auth-only-shell {
    width: min(760px, calc(100% - 24px));
    padding-top: 0;
    padding-bottom: 48px;
}

.signup-page-shell {
    padding-top: 24px;
}

.signup-page-shell .signup-panel {
    margin-top: 0;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(10, 20, 32, 0.7);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #04141f;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.brand-text small {
    color: var(--text-soft);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.62rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--text-soft);
    font-size: 0.96rem;
}

.main-nav a {
    transition: color 180ms ease;
}

.main-nav a:hover {
    color: var(--white);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-theme-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.landing-theme-toggle:hover {
    color: var(--primary);
    background: rgba(94, 234, 212, 0.1);
    border-color: rgba(94, 234, 212, 0.5);
    transform: translateY(-1px);
}

.landing-theme-toggle:focus-visible {
    outline: 3px solid rgba(94, 234, 212, 0.35);
    outline-offset: 3px;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 0.9rem 1.4rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #04141f;
    box-shadow: 0 16px 30px rgba(96, 165, 250, 0.3);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
}

.large {
    padding: 1.08rem 1.5rem;
    min-width: 170px;
}

.hero-section {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 42px;
    padding: 52px 0 28px;
}

.eyebrow,
.mini-label {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d8f9ff;
    background: rgba(94, 234, 212, 0.12);
    border: 1px solid rgba(94, 234, 212, 0.2);
}

.hero-copy h1 {
    margin: 20px 0 18px;
    font-size: clamp(2.9rem, 5vw, 5rem);
    line-height: 0.96;
    letter-spacing: -0.065em;
}

.hero-copy p {
    margin: 0;
    max-width: 620px;
    font-size: 1.08rem;
    color: var(--text-soft);
    line-height: 1.8;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 30px;
}

.trust-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    color: var(--text-soft);
    font-size: 0.96rem;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
}

.soft-glow {
    position: absolute;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.2), rgba(96, 165, 250, 0.04) 45%, transparent 70%);
    filter: blur(18px);
}

.dashboard-frame {
    position: relative;
    width: min(100%, 560px);
    border: 1px solid rgba(155, 169, 191, 0.2);
    border-radius: 28px;
    padding: 18px;
    background: rgba(9, 20, 31, 0.88);
    box-shadow: var(--shadow);
}

.dashboard-topbar {
    display: flex;
    gap: 10px;
    padding-bottom: 18px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red { background: #f87171; }
.dot.amber { background: #fbbf24; }
.dot.green { background: #4ade80; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.metric-card,
.chart-card,
.activity-card {
    background: rgba(20, 36, 51, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 18px;
}

.hero-metric {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-label {
    color: var(--text-soft);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-metric strong {
    font-size: clamp(1.5rem, 2vw, 2.2rem);
    color: var(--white);
}

.hero-metric small {
    color: var(--primary);
}

.accent {
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.18), rgba(96, 165, 250, 0.08));
}

.chart-card {
    grid-column: span 2;
    min-height: 170px;
}

.chart-bars {
    height: 120px;
    display: flex;
    align-items: end;
    gap: 10px;
    padding-top: 12px;
}

.chart-bars span {
    flex: 1;
    display: block;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%);
    box-shadow: 0 0 24px rgba(94, 234, 212, 0.22);
}

.activity-header {
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: pulse 1.9s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.activity-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    color: var(--text-soft);
}

.activity-card li b {
    color: var(--white);
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 14px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(19, 34, 48, 0.86);
}

.feature-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(110, 231, 183, 0.15);
    font-size: 1.3rem;
    color: var(--primary);
}

.feature-icon i,
.business-icon i {
    display: inline-block;
    font-size: inherit;
    line-height: 1;
}

.feature-item strong {
    display: block;
    margin-bottom: 6px;
}

.feature-item p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
    font-size: 0.96rem;
}

.signup-panel {
    margin-top: 44px;
    background: rgba(10, 22, 34, 0.82);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 26px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-head h2 {
    margin: 10px 0 0;
    font-size: clamp(1.7rem, 2vw, 2.5rem);
    letter-spacing: -0.05em;
}

.step-pill {
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.2);
    color: #dbeafe;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-wrap {
    margin-top: 26px;
}

.progress-bar-track {
    position: relative;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.12);
}

.progress-bar {
    width: 20%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 220ms ease;
}

.signup-form {
    margin-top: 26px;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.step-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.step-badge {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-weight: 700;
    background: rgba(94, 234, 212, 0.12);
    border: 1px solid rgba(94, 234, 212, 0.2);
    color: var(--primary);
}

.step-title-row h3 {
    margin: 0;
    font-size: 1.45rem;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

label span {
    font-weight: 600;
}

.field-feedback {
    min-height: 1em;
    color: var(--danger);
    font-size: 0.76rem;
    font-weight: 600;
}

.field-feedback.is-valid {
    color: var(--accent);
}

label:has(input[name="email"].is-valid) {
    position: relative;
}

label.has-valid-email::after {
    content: '';
    position: absolute;
    top: 38px;
    right: 16px;
    width: 7px;
    height: 13px;
    border-right: 3px solid var(--accent);
    border-bottom: 3px solid var(--accent);
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    animation: signup-check-in 260ms ease-out forwards;
    pointer-events: none;
}

@keyframes signup-check-in {
    0% { opacity: 0; transform: rotate(45deg) scale(0); }
    70% { opacity: 1; transform: rotate(45deg) scale(1.18); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--danger);
}

input.is-valid {
    border-color: var(--accent);
    padding-right: 42px;
}

@media (prefers-reduced-motion: reduce) {
    label.has-valid-email::after {
        animation: none;
        transform: rotate(45deg) scale(1);
    }
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 28, 38, 0.82);
    color: var(--white);
    border-radius: 14px;
    padding: 0.95rem 1rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(94, 234, 212, 0.7);
    box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.14);
}

.full-span {
    grid-column: 1 / -1;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.business-card {
    position: relative;
    padding: 22px 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 28, 38, 0.82);
    color: var(--white);
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.business-card:hover,
.business-card.active {
    border-color: rgba(94, 234, 212, 0.5);
    box-shadow: 0 18px 38px rgba(94, 234, 212, 0.12);
    transform: translateY(-2px);
}

.business-card strong {
    display: block;
    font-size: 1.25rem;
    margin: 14px 0 8px;
}

.business-card small {
    color: var(--text-soft);
    line-height: 1.6;
}

.portal-picker {
    max-width: 1040px;
    margin: 48px auto 0;
}

.portal-picker-copy {
    max-width: 680px;
    margin: 18px 0 26px;
    color: var(--text-soft);
    line-height: 1.7;
}

.portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-card {
    display: flex;
    min-height: 260px;
    flex-direction: column;
}

.portal-card-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 22px;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 700;
}

.portal-footer {
    margin-top: 26px;
}

@media (max-width: 780px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }

    .portal-card {
        min-height: 0;
    }
}

.business-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(96, 165, 250, 0.12);
    font-size: 2rem;
}

.preview-card {
    padding: 22px;
    border-radius: 22px;
    background: rgba(15, 28, 38, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.preview-row:last-child {
    border-bottom: 0;
}

.preview-row span {
    color: var(--text-soft);
}

.preview-row strong {
    color: var(--white);
    font-weight: 600;
    text-align: right;
}

.signup-review-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(234, 88, 12, 0.3);
    border-radius: 16px;
    color: #9a3412;
    background: rgba(255, 247, 237, 0.96);
    animation: review-alert-in 240ms ease-out;
}

.signup-review-alert[hidden] {
    display: none;
}

.signup-review-alert-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: #c2410c;
    background: rgba(251, 146, 60, 0.18);
    font-size: 1rem;
}

.signup-review-alert-copy {
    min-width: 0;
    flex: 1;
}

.signup-review-alert-copy strong {
    display: block;
    color: #7c2d12;
    font-size: 0.88rem;
}

.signup-review-alert-copy p {
    margin: 3px 0 0;
    color: #9a3412;
    font-size: 0.8rem;
    line-height: 1.45;
}

.signup-review-alert-action {
    flex: 0 0 auto;
    border: 1px solid rgba(194, 65, 12, 0.3);
    border-radius: 9px;
    padding: 8px 10px;
    color: #9a3412;
    background: transparent;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.signup-review-alert-action:hover {
    background: rgba(251, 146, 60, 0.14);
}

@keyframes review-alert-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

html[data-theme="dark"] .signup-review-alert {
    border-color: rgba(251, 146, 60, 0.32);
    color: #fed7aa;
    background: rgba(124, 45, 18, 0.2);
}

html[data-theme="dark"] .signup-review-alert-copy strong {
    color: #fed7aa;
}

html[data-theme="dark"] .signup-review-alert-copy p,
html[data-theme="dark"] .signup-review-alert-action {
    color: #fdba74;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .signup-review-alert {
        border-color: rgba(251, 146, 60, 0.32);
        color: #fed7aa;
        background: rgba(124, 45, 18, 0.2);
    }

    html[data-theme="system"] .signup-review-alert-copy strong {
        color: #fed7aa;
    }

    html[data-theme="system"] .signup-review-alert-copy p,
    html[data-theme="system"] .signup-review-alert-action {
        color: #fdba74;
    }
}

@media (max-width: 640px) {
    .signup-review-alert {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .signup-review-alert-action {
        margin-left: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .signup-review-alert {
        animation: none;
    }
}

.success-wrap {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    padding: 26px 14px 10px;
}

.success-badge {
    width: 120px;
    height: 120px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.18), rgba(96, 165, 250, 0.22));
    border: 1px solid rgba(94, 234, 212, 0.3);
    box-shadow: 0 18px 40px rgba(94, 234, 212, 0.12);
    animation: pop 0.7s ease backwards;
}

.success-badge span {
    font-size: 3.4rem;
    font-weight: 800;
    color: var(--primary);
}

@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-wrap h3 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.8rem);
    letter-spacing: -0.05em;
}

.success-wrap p {
    color: var(--text-soft);
    font-size: 1.04rem;
    line-height: 1.8;
    max-width: 440px;
    margin: 14px auto 0;
}

.success-actions {
    margin-top: 26px;
}

.ribbon {
    position: absolute;
    top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #02151e;
    background: linear-gradient(135deg, var(--primary), #d7fffc);
    box-shadow: 0 12px 24px rgba(94, 234, 212, 0.2);
    transform: rotate(-18deg);
}

.ribbon-left {
    left: 22px;
}

.ribbon-right {
    right: 22px;
    transform: rotate(18deg);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

#prevBtn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#prevBtn.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 980px) {
    .hero-section,
    .feature-strip,
    .business-grid,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        flex-wrap: wrap;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-copy h1 {
        letter-spacing: -0.04em;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 18px, 1200px);
    }

    .site-header {
        padding: 14px 12px;
    }

    .brand-wrap {
        flex: 1;
    }

    .nav-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .panel-head,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .step-pill {
        align-self: flex-start;
    }
}
