:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #667085;
    --line: #e5eaf1;
    --primary: #635bff;
    --primary-dark: #4e46e5;
    --success: #19a974;
    --success-soft: #eafaf3;
    --sidebar: #101828;
    --sidebar-soft: #1d2939;
    --shadow: 0 18px 55px rgba(16, 24, 40, .08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
}

button, input {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    background: #eef2f8;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr);
}

.auth-brand {
    position: relative;
    overflow: hidden;
    padding: 52px clamp(38px, 7vw, 110px);
    color: #fff;
    background:
        radial-gradient(circle at 15% 15%, rgba(121, 114, 255, .55), transparent 28%),
        radial-gradient(circle at 90% 80%, rgba(46, 211, 183, .18), transparent 26%),
        linear-gradient(145deg, #111827 0%, #1d2856 55%, #302a78 100%);
}

.auth-brand::after {
    content: "";
    position: absolute;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    right: -210px;
    top: 20%;
    box-shadow:
        0 0 0 70px rgba(255,255,255,.025),
        0 0 0 140px rgba(255,255,255,.02);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(145deg, #817cff, #584cff);
    color: #fff;
    font-weight: 800;
    letter-spacing: -.04em;
    box-shadow: 0 12px 28px rgba(99, 91, 255, .35);
}

.brand-mark.small {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 13px;
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    margin-left: 10px;
    vertical-align: middle;
}

.auth-pitch {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin-top: clamp(90px, 15vh, 170px);
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--primary);
    margin-bottom: 12px;
}

.auth-brand .eyebrow {
    color: #a7c7ff;
}

.auth-pitch h1 {
    margin: 0;
    max-width: 650px;
    font-size: clamp(36px, 4.2vw, 64px);
    line-height: 1.03;
    letter-spacing: -.05em;
}

.auth-pitch > p {
    max-width: 560px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.7;
}

.feature-list {
    display: grid;
    gap: 13px;
    margin-top: 38px;
}

.feature-list > div {
    display: grid;
    gap: 3px;
    padding: 15px 18px;
    max-width: 520px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
    backdrop-filter: blur(8px);
}

.feature-list strong {
    font-size: 14px;
}

.feature-list span {
    color: #b8c2d3;
    font-size: 13px;
}

.auth-card-wrap {
    display: grid;
    place-items: center;
    padding: 40px;
}

.auth-card {
    width: min(100%, 500px);
    padding: clamp(30px, 5vw, 54px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin: 0 0 8px;
    font-size: 32px;
    letter-spacing: -.035em;
}

.muted {
    color: var(--muted);
}

.form-stack {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.form-stack label {
    display: grid;
    gap: 8px;
}

.form-stack label > span {
    font-size: 13px;
    font-weight: 700;
}

.form-stack input[type="text"],
.form-stack input[type="email"],
.form-stack input[type="password"] {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #d7dde7;
    border-radius: 11px;
    outline: none;
    background: #fff;
    transition: .2s;
}

.form-stack input:focus {
    border-color: #8e88ff;
    box-shadow: 0 0 0 4px rgba(99, 91, 255, .09);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.check-row {
    grid-template-columns: auto 1fr !important;
    align-items: center;
    gap: 9px !important;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 11px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #756dfb);
    box-shadow: 0 10px 25px rgba(99, 91, 255, .2);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-block {
    width: 100%;
    min-height: 50px;
}

.auth-footer {
    margin-top: 24px;
    padding-top: 22px;
    text-align: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.alert {
    padding: 13px 15px;
    margin: 18px 0;
    border-radius: 11px;
    font-size: 14px;
}

.alert ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.alert-error {
    background: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
}

.alert-success {
    background: var(--success-soft);
    color: #087953;
    border: 1px solid #b9f0d8;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    color: #d0d5dd;
    background: var(--sidebar);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 24px;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
}

.nav-caption {
    margin: 8px 10px 10px;
    color: #667085;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
}

.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    padding: 0 12px;
    border-radius: 10px;
    color: #aeb7c6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
}

.sidebar-nav a.active,
.sidebar-nav a:hover:not(.disabled) {
    color: #fff;
    background: var(--sidebar-soft);
}

.sidebar-nav a small {
    margin-left: auto;
    color: #667085;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sidebar-nav a.disabled {
    cursor: default;
    opacity: .72;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 14px 8px 4px;
    border-top: 1px solid #273448;
}

.company-mini {
    display: grid;
    gap: 3px;
    margin-bottom: 12px;
}

.company-mini strong {
    color: #fff;
    font-size: 13px;
}

.company-mini span {
    overflow: hidden;
    color: #7f8a9d;
    font-size: 11px;
    text-overflow: ellipsis;
}

.link-button,
.back-link {
    padding: 0;
    border: 0;
    color: #98a2b3;
    background: none;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.main-content {
    width: 100%;
    max-width: 1550px;
    padding: 38px clamp(28px, 4vw, 64px) 80px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.topbar h1 {
    margin: 0 0 7px;
    font-size: 33px;
    letter-spacing: -.04em;
}

.topbar p {
    margin: 0;
    color: var(--muted);
}

.company-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 320px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
    font-weight: 750;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(25,169,116,.12);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    align-items: center;
    gap: 28px;
    padding: 34px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 95% 15%, rgba(255,255,255,.15), transparent 25%),
        linear-gradient(135deg, #342e86, #635bff 60%, #817bff);
    box-shadow: 0 22px 45px rgba(56, 49, 150, .18);
}

.hero-panel .eyebrow {
    color: #d8d6ff;
}

.hero-panel h2 {
    max-width: 760px;
    margin: 0;
    font-size: 29px;
    letter-spacing: -.035em;
}

.hero-panel p {
    max-width: 760px;
    color: #dddfff;
    line-height: 1.6;
}

.hero-panel .btn {
    margin-top: 7px;
    background: #fff;
    color: #4338ca;
    box-shadow: none;
}

.hero-metric {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 145px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    background: rgba(255,255,255,.08);
}

.hero-metric strong {
    font-size: 47px;
    letter-spacing: -.05em;
}

.hero-metric span {
    color: #d7d7f6;
    font-size: 12px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    margin: 38px 0 18px;
}

.section-head h2,
.onboarding-panel h2 {
    margin: 0 0 5px;
    font-size: 22px;
    letter-spacing: -.025em;
}

.section-head p,
.onboarding-panel p {
    margin: 0;
    color: var(--muted);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.service-card {
    position: relative;
    min-height: 250px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 28px rgba(16, 24, 40, .045);
}

.service-card.coming-soon {
    background: #fbfcfe;
}

.service-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 22px;
    border-radius: 13px;
    color: var(--primary);
    background: #f0efff;
    font-weight: 900;
}

.service-card-top {
    position: absolute;
    right: 18px;
    top: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 999px;
    color: #667085;
    background: #eef1f5;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.badge-success {
    color: #087953;
    background: var(--success-soft);
}

.service-card h3 {
    margin: 0 0 9px;
    font-size: 18px;
}

.service-card p {
    min-height: 63px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.service-link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.muted-link {
    color: #98a2b3;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: grid;
    gap: 5px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.stat-card > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.stat-card strong {
    font-size: 34px;
    letter-spacing: -.04em;
}

.stat-card small {
    color: #98a2b3;
}

.onboarding-panel {
    display: grid;
    grid-template-columns: minmax(260px, .75fr) minmax(420px, 1.25fr);
    gap: 38px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.steps {
    display: grid;
    gap: 10px;
}

.step {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 13px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.step > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    font-weight: 850;
}

.step div {
    display: grid;
    gap: 3px;
}

.step strong {
    font-size: 13px;
}

.step small {
    color: var(--muted);
}

@media (max-width: 1150px) {
    .service-grid,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .onboarding-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 850px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-bottom {
        display: none;
    }

    .main-content {
        padding: 26px 18px 60px;
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .hero-metric {
        display: none;
    }
}

@media (max-width: 560px) {
    .auth-card-wrap {
        padding: 18px;
    }

    .auth-card {
        padding: 26px 21px;
    }

    .form-grid,
    .service-grid,
    .stats-grid,
    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .topbar {
        display: block;
    }

    .company-pill {
        margin-top: 16px;
    }
}
