:root {
    --bg: #edf3fb;
    --bg-soft: #f6f9fd;
    --surface: rgba(255,255,255,0.92);
    --surface-2: #f8fbff;
    --surface-3: #eef4fb;
    --text: #132033;
    --muted: #5f7088;
    --border: #d9e4f1;
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --accent: #14b8a6;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow-sm: 0 10px 30px rgba(13, 31, 62, 0.08);
    --shadow-md: 0 22px 60px rgba(13, 31, 62, 0.12);
    --radius: 22px;
    --radius-sm: 16px;
}

html[data-theme="black"] {
    --bg: #08111b;
    --bg-soft: #0d1825;
    --surface: rgba(15,24,37,0.9);
    --surface-2: #122032;
    --surface-3: #17283c;
    --text: #eef4fb;
    --muted: #98a9be;
    --border: #20344b;
    --primary: #60a5fa;
    --primary-2: #3b82f6;
    --accent: #22c55e;
}

html[data-theme="blue"] {
    --bg: #eaf3ff;
    --bg-soft: #f2f7ff;
    --surface: rgba(255,255,255,0.95);
    --surface-2: #f4f8ff;
    --surface-3: #ebf2ff;
    --text: #14243a;
    --muted: #5b6d88;
    --border: #d4e2fb;
    --primary: #2563eb;
    --primary-2: #1e40af;
    --accent: #06b6d4;
}

html[data-theme="green"] {
    --bg: #edf9f2;
    --bg-soft: #f6fcf8;
    --surface: rgba(255,255,255,0.95);
    --surface-2: #f5fbf7;
    --surface-3: #e9f7ee;
    --text: #173125;
    --muted: #607767;
    --border: #d6eadb;
    --primary: #16a34a;
    --primary-2: #15803d;
    --accent: #0ea5a4;
}

html[data-theme="pink"] {
    --bg: #fff1f7;
    --bg-soft: #fff8fb;
    --surface: rgba(255,255,255,0.95);
    --surface-2: #fff6fa;
    --surface-3: #fee9f1;
    --text: #341827;
    --muted: #866474;
    --border: #f2d7e3;
    --primary: #db2777;
    --primary-2: #be185d;
    --accent: #8b5cf6;
}

html[data-theme="orange"] {
    --bg: #fff5ec;
    --bg-soft: #fff9f4;
    --surface: rgba(255,255,255,0.95);
    --surface-2: #fff7ef;
    --surface-3: #ffeddc;
    --text: #382313;
    --muted: #866956;
    --border: #f4dcc4;
    --primary: #ea580c;
    --primary-2: #c2410c;
    --accent: #f59e0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background:
        radial-gradient(circle at top left, rgba(37,99,235,0.10), transparent 30%),
        radial-gradient(circle at top right, rgba(20,184,166,0.10), transparent 26%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

h1, h2, h3, p { margin-top: 0; }

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(37,99,235,0.10);
    color: var(--primary-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.chip-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}

.hero-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    transition: 0.22s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.full { width: 100%; }

.input, .textarea, select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 16px;
    outline: none;
    transition: 0.2s ease;
}

.input, select {
    min-height: 52px;
    padding: 0 16px;
}

.textarea {
    min-height: 130px;
    padding: 14px 16px;
    resize: vertical;
}

.textarea-lg {
    min-height: 190px;
}

.input:focus, .textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.10);
}

label span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.password-wrap {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

.alert {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-error {
    background: rgba(220,38,38,0.10);
    color: var(--danger);
    border: 1px solid rgba(220,38,38,0.20);
}

.global-notice {
    margin: 0 24px 18px;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 700;
}

.global-notice.success {
    background: rgba(22,163,74,0.10);
    color: var(--success);
    border: 1px solid rgba(22,163,74,0.20);
}

/* Landing */

.landing-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 22px;
}

.landing-topbar,
.content-topbar,
.builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.brand,
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand h1 { margin: 0; font-size: 18px; }
.brand p, .sidebar-brand small { margin: 4px 0 0; color: var(--muted); }

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: var(--shadow-sm);
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.landing-main {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
}

.landing-hero-card,
.landing-preview-card,
.feature-spot-card,
.auth-card,
.auth-showcase,
.panel,
.stat-card,
.action-tile,
.resume-record-card,
.control-strip-card,
.ats-box,
.hero-dashboard-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.landing-hero-card,
.landing-preview-card,
.hero-dashboard-card {
    padding: 28px;
}

.landing-hero-card h2 {
    margin-bottom: 14px;
    font-size: 44px;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.hero-copy {
    font-size: 16px;
    line-height: 1.8;
    color: var(--muted);
    max-width: 780px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hero-metrics {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}

.metric-card,
.showcase-mini-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
}

.metric-card strong,
.showcase-mini-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.metric-card span,
.showcase-mini-card span,
.showcase-mini-card small {
    color: var(--muted);
    line-height: 1.5;
}

.preview-mock-browser {
    background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 14px;
    min-height: 100%;
}

.mock-browser-top {
    display: flex;
    gap: 8px;
    padding: 8px 10px 16px;
}
.mock-browser-top span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(148,163,184,0.5);
}

.mock-preview-grid {
    display: grid;
    grid-template-columns: 0.92fr 1.08fr;
    gap: 14px;
    min-height: 470px;
}

.mock-left-panel,
.mock-right-panel {
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
}

.mock-pill,
.mock-block,
.mock-resume-head,
.mock-line,
.mock-section {
    background: linear-gradient(90deg, rgba(148,163,184,0.18), rgba(148,163,184,0.30), rgba(148,163,184,0.18));
    border-radius: 14px;
}

.mock-pill { height: 16px; margin-bottom: 12px; width: 72%; }
.mock-pill.wide { width: 94%; height: 22px; }
.mock-block { height: 110px; margin-top: 14px; }
.mock-block.tall { height: 180px; }
.mock-resume-head { height: 90px; margin-bottom: 18px; }
.mock-line { height: 14px; margin-bottom: 10px; width: 100%; }
.mock-line.w90 { width: 90%; }
.mock-line.w75 { width: 75%; }
.mock-section { height: 120px; margin-top: 16px; }
.mock-section.small { height: 72px; }

.landing-feature-row {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.feature-spot-card {
    padding: 22px;
}
.feature-spot-card p {
    color: var(--muted);
    line-height: 1.7;
}

/* Auth */

.auth-shell {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 22px;
}

.auth-showcase {
    padding: 28px;
    display: flex;
    align-items: stretch;
}
.auth-showcase-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-showcase h1 {
    font-size: 42px;
    line-height: 1.08;
    margin-bottom: 14px;
}
.auth-showcase p {
    color: var(--muted);
    line-height: 1.8;
}
.auth-showcase-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 560px;
    padding: 26px;
}

.auth-card-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.theme-form-inline { min-width: 100px; }
.input-sm { min-height: 42px; }

.auth-divider {
    position: relative;
    margin: 18px 0;
    text-align: center;
}
.auth-divider:before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    border-top: 1px solid var(--border);
}
.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 12px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.auth-bottom-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}
.auth-bottom-links a {
    color: var(--primary);
    font-weight: 700;
}

/* Shell */

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
}

.sidebar {
    padding: 18px;
    border-right: 1px solid var(--border);
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
}
.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}
.side-nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 700;
    border: 1px solid transparent;
}
.side-nav a:hover,
.side-nav a.active {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

.main-content {
    padding: 22px;
}

.content-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-dashboard-card {
    margin-top: 18px;
}
.hero-dashboard-card h2 {
    font-size: 32px;
    line-height: 1.15;
    margin-bottom: 10px;
}
.hero-dashboard-card p {
    color: var(--muted);
    line-height: 1.8;
}
.hero-dashboard-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.stats-grid {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}
.stats-grid-4 {
    grid-template-columns: repeat(4, minmax(0,1fr));
}
.stat-card {
    padding: 20px;
}
.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
}
.stat-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 8px;
}
.stat-card small {
    color: var(--muted);
    line-height: 1.6;
}
.stat-card-highlight {
    background: linear-gradient(135deg, rgba(37,99,235,0.10), rgba(20,184,166,0.08));
}

.panel-grid {
    margin-top: 18px;
    display: grid;
    gap: 18px;
}
.panel-grid-dashboard {
    grid-template-columns: 0.9fr 1.1fr;
}
.panel {
    padding: 22px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.panel-head h2 { margin-bottom: 6px; }
.panel-head p {
    margin: 0;
    color: var(--muted);
}

.action-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
}
.action-tile {
    padding: 18px;
    border-radius: 20px;
    background: var(--surface-2);
}
.action-tile strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}
.action-tile span {
    color: var(--muted);
    line-height: 1.6;
}
.action-tile.disabled {
    opacity: 0.75;
    cursor: default;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
}
.table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.table tbody tr:hover {
    background: rgba(37,99,235,0.04);
}

.empty-state {
    padding: 22px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
}
.empty-state strong {
    display: block;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
}

/* Builder */

.builder-page {
    padding: 22px;
}

.advanced-builder-header {
    position: sticky;
    top: 0;
    z-index: 30;
}

.builder-header-left h1 {
    margin-bottom: 6px;
}
.builder-header-left p {
    color: var(--muted);
    margin: 0;
}

.builder-header-right {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.builder-control-strip {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: 14px;
}
.control-strip-card {
    padding: 16px;
}
.control-strip-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.control-strip-card strong {
    display: block;
    font-size: 16px;
    line-height: 1.35;
}

.builder-main {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 470px;
    gap: 18px;
    align-items: start;
}

.builder-step-strip {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.horizontal-scroll {
    overflow: auto;
    padding-bottom: 4px;
}
.step-pill {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.step-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    border-color: transparent;
}

.builder-form {
    display: grid;
    gap: 16px;
}
.form-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}
.form-card.step-active {
    box-shadow: var(--shadow-md);
}
.form-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.form-card-head p {
    color: var(--muted);
    margin: 0;
    line-height: 1.7;
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hint-box,
.skills-suggest-box {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.hint-box {
    color: var(--muted);
    line-height: 1.7;
}
.suggest-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.suggest-chip {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
}

.builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.builder-right {
    position: sticky;
    top: 136px;
    display: grid;
    gap: 14px;
}

.live-status-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
}
.live-status-item {
    padding: 16px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.live-status-item span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.live-status-item strong {
    font-size: 14px;
    line-height: 1.4;
}

.ats-box {
    padding: 20px;
}
.ats-hint-list {
    margin: 0;
    padding-left: 18px;
}
.ats-hint-list li {
    margin-bottom: 10px;
    color: var(--muted);
    line-height: 1.6;
}

.preview-paper {
    background: #ffffff;
    color: #0f172a;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid #d8e2ef;
    box-shadow: var(--shadow-md);
}

.preview-head {
    padding: 28px 28px 18px;
    background: linear-gradient(135deg, #f7fbff, #edf4ff);
    border-bottom: 1px solid #dbe7f5;
}
.preview-head h2 {
    margin: 0;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.preview-head p {
    margin: 8px 0 0;
    color: #4b5d73;
    line-height: 1.7;
}
.preview-subline {
    color: #1d4ed8 !important;
    font-weight: 800;
}
.preview-links:empty { display: none; }

.preview-block {
    padding: 18px 28px 0;
}
.preview-block h3 {
    margin: 0 0 8px;
    font-size: 12px;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}
.preview-block p {
    margin: 0;
    color: #334155;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}
.preview-footer {
    padding: 22px 28px 28px;
    color: #64748b;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
}

/* Resume list */

.resume-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
}
.resume-record-card {
    padding: 20px;
}
.resume-record-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.resume-record-top h3 {
    margin: 0;
    font-size: 18px;
}
.resume-record-meta {
    display: grid;
    gap: 8px;
    color: var(--muted);
    line-height: 1.6;
}
.resume-record-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Utility */

.mobile-only { display: none; }

/* Responsive */

@media (max-width: 1280px) {
    .builder-main {
        grid-template-columns: 1fr;
    }

    .builder-right {
        position: static;
    }
}

@media (max-width: 1080px) {
    .landing-main,
    .auth-shell,
    .panel-grid-dashboard {
        grid-template-columns: 1fr;
    }

    .hero-metrics,
    .landing-feature-row,
    .stats-grid-4,
    .builder-control-strip,
    .resume-card-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 280px;
        height: 100vh;
        z-index: 60;
        transition: 0.25s ease;
        box-shadow: var(--shadow-md);
    }

    .sidebar.is-open {
        left: 0;
    }

    .mobile-only {
        display: inline-flex;
    }
}

@media (max-width: 760px) {
    .landing-shell,
    .builder-page,
    .main-content,
    .auth-shell {
        padding: 14px;
    }

    .landing-topbar,
    .content-topbar,
    .builder-header {
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .top-actions,
    .builder-header-right,
    .builder-actions,
    .hero-actions,
    .hero-dashboard-actions {
        width: 100%;
    }

    .top-actions .btn,
    .builder-header-right .btn,
    .builder-header-right .input,
    .builder-actions .btn,
    .hero-actions .btn,
    .hero-dashboard-actions .btn {
        width: 100%;
    }

    .landing-hero-card h2,
    .auth-showcase h1,
    .hero-dashboard-card h2 {
        font-size: 30px;
    }

    .hero-metrics,
    .landing-feature-row,
    .stats-grid-4,
    .builder-control-strip,
    .grid-2,
    .resume-card-grid,
    .live-status-bar,
    .action-tile-grid,
    .auth-showcase-grid {
        grid-template-columns: 1fr;
    }

    .mock-preview-grid {
        grid-template-columns: 1fr;
    }

    .preview-head {
        padding: 20px 18px 14px;
    }
    .preview-head h2 {
        font-size: 28px;
    }
    .preview-block {
        padding: 16px 18px 0;
    }
    .preview-footer {
        padding: 18px;
    }
}