/* ── Job Angel — Main Stylesheet ─────────────────────────────────
   Warm light theme with earthy tones, clean type,
   and subtle depth.
   ──────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── Reset & Variables ────────────────────────────────────────── */

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

:root {
    --bg-page: #faf9f7;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f5f3f0;
    --bg-input: #ffffff;
    --bg-input-disabled: #f0eeeb;
    --border: #e2dfd9;
    --border-light: #eceae5;
    --border-focus: #8b7355;

    --text-primary: #2c2825;
    --text-secondary: #6b6460;
    --text-muted: #9e9790;
    --text-inverse: #ffffff;

    --accent: #8b7355;
    --accent-hover: #74603f;
    --accent-light: #f0ebe4;
    --accent-subtle: rgba(139, 115, 85, 0.08);

    --success: #3a7d5c;
    --success-bg: #edf7f1;
    --success-border: #c3e0cf;
    --warning: #a07630;
    --warning-bg: #fdf5e8;
    --warning-border: #e6d5b0;
    --error: #b84040;
    --error-bg: #fdf0f0;
    --error-border: #e6bfbf;
    --info: #4a7196;
    --info-bg: #edf3f9;
    --info-border: #bcd1e2;

    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

    --transition-fast: 120ms ease;
    --transition-normal: 200ms ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

::selection {
    background: var(--accent-light);
    color: var(--accent-hover);
}

/* ── Layout ───────────────────────────────────────────────────── */

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

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-page);
}

/* ── Navbar ───────────────────────────────────────────────────── */

.navbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.navbar-brand:hover {
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-brand span {
    color: var(--accent);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    text-decoration: none;
}

.navbar-links a:hover {
    color: var(--text-primary);
    background: var(--bg-surface-alt);
    text-decoration: none;
}

.navbar-links a.active {
    color: var(--accent-hover);
    background: var(--accent-light);
}

/* ── Cards ────────────────────────────────────────────────────── */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.card-auth {
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.card-header {
    text-align: center;
    margin-bottom: 28px;
}

.card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Forms ────────────────────────────────────────────────────── */

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

.form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-group input:disabled {
    background: var(--bg-input-disabled);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 10px;
    transition: background var(--transition-fast);
}

.form-group input[type="file"]::file-selector-button:hover {
    background: var(--accent-hover);
}

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

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
}

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-sm);
    color: var(--text-inverse);
}

.btn-primary:active {
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-surface-alt);
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--error);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: #a33636;
    color: var(--text-inverse);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* ── Alerts / Flash Messages ──────────────────────────────────── */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 20px;
    border: 1px solid;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.alert-error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

.alert-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.alert-info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info);
}

/* ── Tables ───────────────────────────────────────────────────── */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--bg-surface-alt);
    padding: 10px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 12px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--accent-subtle);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ── Badges / Status Pills ────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid;
}

.badge-active {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.badge-pending {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.badge-applied {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info);
}

.badge-skipped {
    background: var(--bg-surface-alt);
    border-color: var(--border);
    color: var(--text-muted);
}

.badge-error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

/* ── Dashboard ────────────────────────────────────────────────── */

.page-header {
    padding: 28px 0 24px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: box-shadow var(--transition-normal);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
    font-weight: 500;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-tabs {
    display: inline-flex;
    gap: 8px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    margin-bottom: 20px;
}

.section-tab {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    text-decoration: none;
}

.section-tab:hover {
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-surface);
}

.section-tab.active {
    color: var(--accent-hover);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
}

/* ── Settings ─────────────────────────────────────────────────── */

.settings-section {
    margin-bottom: 36px;
}

.settings-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 3px;
    letter-spacing: -0.01em;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-section .subtitle {
    color: var(--text-muted);
    font-size: 0.825rem;
    margin-bottom: 16px;
}

.settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* ── Verification Banner ──────────────────────────────────────── */

.verify-banner {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.verify-banner p {
    color: var(--warning);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ── Apply Confirm Page ──────────────────────────────────────── */

.confirm-page {
    max-width: 520px;
    margin: 48px auto;
    padding: 0 24px;
}

.confirm-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-light);
    margin-bottom: 20px;
}

.confirm-icon svg {
    width: 26px;
    height: 26px;
    color: var(--accent);
    stroke: var(--accent);
}

.confirm-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.confirm-card .job-title {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.confirm-card .confirm-notice {
    font-size: 0.825rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-card .already-applied {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: left;
}

.confirm-card .already-applied p {
    color: var(--success);
    font-size: 0.875rem;
}

.confirm-card .back-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.confirm-card .back-link:hover {
    color: var(--text-secondary);
}

/* ── Empty State ──────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Footer ───────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.775rem;
    border-top: 1px solid var(--border-light);
    margin-top: 48px;
}

/* ── Utilities ────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.825rem; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

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

    .verify-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-links {
        gap: 4px;
    }

    .section-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .section-tab {
        text-align: center;
    }

    .confirm-page {
        margin: 24px auto;
    }
}
