:root {
    --navy-950: #071827;
    --navy-900: #0b2235;
    --navy-800: #12324a;
    --blue-600: #176b9b;
    --blue-500: #2389bd;
    --cyan-100: #dff5ff;
    --red-600: #c9252d;
    --red-500: #e33842;
    --green-600: #23855a;
    --amber-600: #b56a0b;
    --slate-900: #17212b;
    --slate-700: #465765;
    --slate-500: #71808b;
    --slate-300: #cdd6dc;
    --slate-200: #e4eaee;
    --slate-100: #f1f5f7;
    --white: #ffffff;
    --shadow: 0 18px 50px rgba(7, 24, 39, .12);
    --radius-lg: 22px;
    --radius-md: 14px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

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

a { color: inherit; text-decoration: none; }

button, input { font: inherit; }

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

.brand-mark {
    width: 44px;
    height: 50px;
    display: grid;
    place-items: center;
    color: var(--white);
    background: linear-gradient(150deg, var(--red-500), var(--red-600));
    clip-path: polygon(50% 0, 94% 16%, 88% 69%, 50% 100%, 12% 69%, 6% 16%);
    font-weight: 900;
    letter-spacing: -.04em;
    box-shadow: 0 10px 24px rgba(201, 37, 45, .25);
}

.brand-copy strong,
.brand-copy span { display: block; }

.brand-copy strong {
    font-size: 1.05rem;
    letter-spacing: .02em;
}

.brand-copy span {
    margin-top: 2px;
    font-size: .72rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: .15em;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
    background: var(--white);
}

.auth-hero {
    position: relative;
    overflow: hidden;
    padding: 58px clamp(34px, 6vw, 94px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--white);
    background:
        radial-gradient(circle at 85% 15%, rgba(35, 137, 189, .38), transparent 28%),
        radial-gradient(circle at 10% 85%, rgba(227, 56, 66, .20), transparent 30%),
        linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: auto -15% -38% 18%;
    height: 70%;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 50%;
    transform: rotate(-8deg);
}

.auth-hero .brand-copy span { color: rgba(255,255,255,.62); }

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 80px 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    color: rgba(255,255,255,.84);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .13em;
}

.eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4fd39d;
    box-shadow: 0 0 0 5px rgba(79, 211, 157, .12);
}

.hero-copy h1 {
    margin: 24px 0 18px;
    max-width: 720px;
    font-size: clamp(2.4rem, 5vw, 4.7rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.hero-copy p {
    max-width: 570px;
    margin: 0;
    color: rgba(255,255,255,.72);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero-points {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-point {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 999px;
    color: rgba(255,255,255,.74);
    font-size: .8rem;
    background: rgba(255,255,255,.04);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px clamp(24px, 5vw, 72px);
    background: linear-gradient(180deg, #fff, #f8fbfc);
}

.auth-card {
    width: min(100%, 460px);
}

.auth-card h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -.035em;
}

.auth-card > p {
    margin: 10px 0 30px;
    color: var(--slate-500);
    line-height: 1.6;
}

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: .83rem;
    font-weight: 750;
    color: var(--slate-700);
}

.form-control {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--slate-300);
    border-radius: 12px;
    outline: none;
    color: var(--slate-900);
    background: var(--white);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(35, 137, 189, .12);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 4px 0 22px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-700);
    font-size: .86rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    width: 100%;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-600), var(--navy-800));
    box-shadow: 0 12px 28px rgba(23, 107, 155, .23);
}

.btn-danger {
    color: var(--white);
    background: var(--red-600);
}

.alert {
    margin-bottom: 20px;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: .86rem;
    line-height: 1.5;
}

.alert-error {
    color: #8b1f25;
    background: #fff0f1;
    border: 1px solid #ffd0d3;
}

.alert-success {
    color: #17603f;
    background: #eaf9f2;
    border: 1px solid #c4eedc;
}

.helper-text {
    margin-top: 7px;
    color: var(--slate-500);
    font-size: .76rem;
    line-height: 1.45;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 28px 22px;
    color: var(--white);
    background: linear-gradient(180deg, var(--navy-950), #0a263b);
}

.sidebar .brand-copy span { color: rgba(255,255,255,.52); }

.sidebar-nav {
    display: grid;
    gap: 7px;
    margin-top: 42px;
}

.nav-label {
    margin: 20px 12px 6px;
    color: rgba(255,255,255,.38);
    font-size: .67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .16em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    color: rgba(255,255,255,.68);
    font-size: .88rem;
    font-weight: 650;
}

.nav-item.active {
    color: var(--white);
    background: rgba(255,255,255,.10);
    box-shadow: inset 3px 0 var(--red-500);
}

.nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .75;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.04);
}

.sidebar-footer strong,
.sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: .82rem; }
.sidebar-footer span { margin-top: 5px; color: rgba(255,255,255,.48); font-size: .72rem; }

.app-main { min-width: 0; }

.topbar {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 clamp(24px, 4vw, 52px);
    border-bottom: 1px solid var(--slate-200);
    background: rgba(255,255,255,.92);
}

.topbar-title strong,
.topbar-title span { display: block; }
.topbar-title strong { font-size: .98rem; }
.topbar-title span { margin-top: 3px; color: var(--slate-500); font-size: .75rem; }

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--blue-600);
    font-weight: 850;
}

.link-button {
    border: 0;
    padding: 7px 9px;
    color: var(--slate-500);
    background: transparent;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700;
}

.content {
    padding: 38px clamp(24px, 4vw, 52px) 60px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: flex-end;
    margin-bottom: 30px;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.15rem);
    letter-spacing: -.05em;
}

.page-heading p {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--slate-500);
    line-height: 1.65;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    color: #17603f;
    background: #e3f7ee;
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2ea66f;
}

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

.stat-card {
    padding: 22px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: 0 8px 22px rgba(7, 24, 39, .04);
}

.stat-card span,
.stat-card strong { display: block; }
.stat-card span { color: var(--slate-500); font-size: .77rem; font-weight: 700; }
.stat-card strong { margin-top: 10px; font-size: 1.7rem; letter-spacing: -.03em; }
.stat-card small { display: block; margin-top: 6px; color: var(--slate-500); font-size: .72rem; }

.section-card {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px;
    border-bottom: 1px solid var(--slate-200);
}

.section-header h2 { margin: 0; font-size: 1.1rem; }
.section-header p { margin: 5px 0 0; color: var(--slate-500); font-size: .8rem; }

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-card {
    min-height: 150px;
    padding: 24px 26px;
    border-right: 1px solid var(--slate-200);
    border-bottom: 1px solid var(--slate-200);
}

.module-card:nth-child(2n) { border-right: 0; }
.module-card:nth-last-child(-n+2) { border-bottom: 0; }

.module-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.module-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--blue-600);
    background: var(--cyan-100);
    font-weight: 900;
}

.module-status {
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--slate-500);
    background: var(--slate-100);
    font-size: .66rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.module-status.next { color: #9c5904; background: #fff2dc; }

.module-card h3 { margin: 18px 0 7px; font-size: .98rem; }
.module-card p { margin: 0; color: var(--slate-500); font-size: .82rem; line-height: 1.55; }

@media (max-width: 980px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { min-height: 430px; }
    .hero-copy { margin: 55px 0; }
    .app-shell { grid-template-columns: 86px minmax(0, 1fr); }
    .sidebar { padding: 24px 14px; }
    .sidebar .brand-copy, .sidebar .nav-item span:last-child, .sidebar .nav-label, .sidebar-footer { display: none; }
    .sidebar .brand { justify-content: center; }
    .nav-item { justify-content: center; padding: 0; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .auth-hero { display: none; }
    .auth-panel { min-height: 100vh; padding: 28px 20px; }
    .app-shell { display: block; }
    .sidebar { display: none; }
    .topbar { padding: 0 18px; }
    .content { padding: 26px 18px 44px; }
    .page-heading { display: block; }
    .page-heading .status-pill { margin-top: 18px; }
    .stats-grid, .module-grid { grid-template-columns: 1fr; }
    .module-card { border-right: 0; }
    .module-card:nth-last-child(-n+2) { border-bottom: 1px solid var(--slate-200); }
    .module-card:last-child { border-bottom: 0; }
}
