* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #07080c;
    --bg-elevated: #0d0f16;
    --bg-card: #12151f;
    --bg-input: #0f1219;
    --text: #e8eaf0;
    --text-muted: #7a7f94;
    --accent: #00e5a0;
    --accent-dim: rgba(0, 229, 160, 0.08);
    --accent-glow: rgba(0, 229, 160, 0.15);
    --accent-strong: rgba(0, 229, 160, 0.25);
    --border: rgba(255,255,255,0.06);
    --border-input: rgba(255,255,255,0.1);
    --danger: #ff4757;
    --warning: #ffa502;
    --success: #00e5a0;
}

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; line-height: 1.15; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ─── Nav ──────────────────────────────────────── */
nav {
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
}
nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ─── Main Section ─────────────────────────────── */
.main-section {
    padding: 60px 0 80px;
}
.section-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}
.form-header {
    margin-bottom: 48px;
}
.form-header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
}
.subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

/* ─── Form ─────────────────────────────────────── */
.job-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.2px;
}
.required { color: var(--accent); }
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
textarea,
select {
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
    width: 100%;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}
select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%237a7f94'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}
select option {
    background: var(--bg-card);
    color: var(--text);
}
textarea {
    resize: vertical;
    min-height: 100px;
}

/* ─── Buttons ──────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #07080c;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}
.btn-primary:hover {
    background: #00cc8e;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
.btn-generate {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}
.btn-back {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
}
.btn-back:hover {
    border-color: rgba(255,255,255,0.15);
    color: var(--text);
}

/* ─── Spinner ──────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(7, 8, 12, 0.3);
    border-top-color: #07080c;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Results Header ───────────────────────────── */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    gap: 24px;
}
.results-header-left {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.results-header h1 {
    font-size: 28px;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}
.results-stats {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}
.result-stat {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 24px;
}
.result-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    display: block;
}
.result-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Candidates Grid ──────────────────────────── */
.candidates-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.candidate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: start;
    transition: all 0.25s;
}
.candidate-card:hover {
    border-color: rgba(0, 229, 160, 0.12);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* Score circle */
.score-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
}
.score-high {
    background: rgba(0, 229, 160, 0.1);
    color: var(--accent);
    border: 2px solid rgba(0, 229, 160, 0.3);
}
.score-medium {
    background: rgba(255, 165, 2, 0.1);
    color: var(--warning);
    border: 2px solid rgba(255, 165, 2, 0.3);
}
.score-low {
    background: rgba(255, 71, 87, 0.08);
    color: var(--danger);
    border: 2px solid rgba(255, 71, 87, 0.2);
}

/* Candidate info */
.candidate-info {
    min-width: 0;
}
.candidate-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}
.candidate-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.candidate-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-muted);
}
.candidate-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.candidate-summary {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

/* Skills */
.candidate-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.skill-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}
.skill-strong {
    background: rgba(0, 229, 160, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 229, 160, 0.2);
}
.skill-moderate {
    background: rgba(255, 165, 2, 0.08);
    color: var(--warning);
    border: 1px solid rgba(255, 165, 2, 0.15);
}
.skill-none {
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.skill-extra {
    background: rgba(100, 100, 255, 0.08);
    color: #8b8bff;
    border: 1px solid rgba(100, 100, 255, 0.15);
}

/* Candidate rate */
.candidate-rate {
    text-align: right;
    flex-shrink: 0;
}
.rate-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.rate-unit {
    font-size: 12px;
    color: var(--text-muted);
}
.availability-tag {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 100px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.avail-now {
    background: rgba(0, 229, 160, 0.1);
    color: var(--accent);
}
.avail-soon {
    background: rgba(255, 165, 2, 0.08);
    color: var(--warning);
}
.avail-later {
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
}

/* ─── Recent Jobs ──────────────────────────────── */
.recent-section {
    padding: 40px 0 80px;
    border-top: 1px solid var(--border);
}
.recent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.recent-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.recent-card:hover {
    border-color: rgba(0, 229, 160, 0.15);
    transform: translateY(-2px);
}
.recent-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.recent-card-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

/* ─── Error toast ──────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--danger);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(255, 71, 87, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ─── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: auto; }
    .candidate-card {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .score-circle {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    .candidate-rate { text-align: left; }
    .results-header {
        flex-direction: column;
    }
    .results-header-left {
        flex-direction: column;
        gap: 12px;
    }
    .job-form { padding: 24px; }
}
