/* ============================================================
   FILE: frontend/style.css
   THEME: Editorial Light — clean, typographic, professional
   FONTS: Playfair Display (headings) + IBM Plex Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
    --bg:           #f5f4f0;
    --surface:      #ffffff;
    --surface2:     #f9f8f5;
    --border:       #e4e2db;
    --border-dark:  #c8c5bc;
    --accent:       #1a1a1a;
    --accent-ink:   #2d5be3;
    --accent-muted: #e8edfc;
    --text:         #1a1a1a;
    --text-mid:     #4a4a4a;
    --text-muted:   #8a8880;
    --danger:       #c0392b;
    --danger-bg:    #fdf0ef;
    --success:      #1a7a4a;
    --success-bg:   #edf7f2;
    --warning:      #8a6000;
    --warning-bg:   #fdf6e3;
    --radius:       6px;
    --radius-lg:    10px;
    --font-head:    'Playfair Display', Georgia, serif;
    --font-body:    'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:       0 4px 16px rgba(0,0,0,0.08);
    --sidebar-w:    220px;
    --transition:   0.18s ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }

input, textarea, select {
    font-family: var(--font-body);
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--border-dark);
    color: var(--text);
    border-radius: var(--radius);
    padding: 9px 12px;
    width: 100%;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent-ink);
    box-shadow: 0 0 0 3px rgba(45,91,227,0.1);
}

textarea { resize: vertical; min-height: 80px; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--accent);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 32px 28px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo-text {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.sidebar-logo-sub {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 3px;
}

.sidebar-nav {
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    padding: 14px 14px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.1px;
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent-ink);
    border-radius: 0 2px 2px 0;
}

.sidebar-footer {
    padding: 20px 28px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.5px;
}

/* ── Main ────────────────────────────────────────────────── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 48px 48px 80px;
    max-width: calc(100vw - var(--sidebar-w));
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.page-header-left h1 {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    line-height: 1.1;
}

.page-header-left p {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 300;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

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

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.stat-value {
    font-family: var(--font-head);
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    color: var(--text);
}

.stat-divider {
    width: 24px;
    height: 2px;
    margin-top: 16px;
    border-radius: 2px;
}

.stat-card:nth-child(1) .stat-divider { background: var(--accent-ink); }
.stat-card:nth-child(2) .stat-divider { background: #e67e22; }
.stat-card:nth-child(3) .stat-divider { background: var(--success); }
.stat-card:nth-child(4) .stat-divider { background: #8e44ad; }

/* ── Card ────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.card-header h2 {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

/* ── Table ───────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }

thead tr { background: var(--surface2); }

th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    color: var(--text-mid);
    vertical-align: middle;
}

td:first-child { color: var(--text); font-weight: 500; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--surface2); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.badge-open,
.badge-hired,
.badge-interview   { background: var(--success-bg);  color: var(--success); }
.badge-closed,
.badge-rejected    { background: var(--danger-bg);   color: var(--danger); }
.badge-applied,
.badge-offered     { background: var(--accent-muted); color: var(--accent-ink); }
.badge-screening,
.badge-pending     { background: var(--warning-bg);  color: var(--warning); }
.badge-phone       { background: #eef2ff; color: #3730a3; }
.badge-tech        { background: #f0fdf4; color: #166534; }
.badge-panel       { background: #fdf4ff; color: #7e22ce; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 12.5px;
    font-weight: 500;
    border: none;
    transition: all var(--transition);
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #333; box-shadow: var(--shadow-sm); }

.btn-blue { background: var(--accent-ink); color: #fff; }
.btn-blue:hover { background: #1e4fd0; }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f0c0bb;
}
.btn-danger:hover { background: #fce4e2; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-sm { padding: 5px 11px; font-size: 11.5px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20,20,20,0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: translateY(12px) scale(0.99); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.modal-title {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.modal-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-weight: 300;
}

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

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

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.modal-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ── Empty & Loading ─────────────────────────────────────── */
.loading {
    text-align: center;
    padding: 56px;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.3px;
}

.loading::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-ink);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 12px auto 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty {
    text-align: center;
    padding: 64px 40px;
    color: var(--text-muted);
}

.empty-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 6px;
}

.empty-desc { font-size: 13px; font-weight: 300; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius);
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow);
    z-index: 9999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.25s ease;
    max-width: 320px;
}

.toast.show  { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }


/* ============================================================
   AUTH PAGES — Login & Register
   ============================================================ */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0f0f13;
    padding: 40px 24px;
    box-sizing: border-box;
    margin: 0;
}

.auth-wrap {
    display: flex;
    width: 100%;
    max-width: 900px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

/* ── Left branding panel ─────────────────────────────────── */
.auth-left {
    width: 280px;
    flex-shrink: 0;
    background: #1a1a2e;
    padding: 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.auth-brand {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
}

.auth-tagline {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    font-weight: 300;
    line-height: 1.8;
}

.auth-dots {
    display: flex;
    gap: 8px;
    margin-top: 40px;
}

.auth-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
}

.auth-dot.active { background: #6c63ff; }

/* ── Right form panel ────────────────────────────────────── */
.auth-right {
    flex: 1;
    background: #13131a;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.auth-title {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 600;
    color: #e8e8f0;
    margin-bottom: 6px;
}

.auth-sub {
    font-size: 12.5px;
    color: rgba(255,255,255,0.28);
    margin-bottom: 32px;
    font-weight: 300;
}

/* ── Auth form inputs ────────────────────────────────────── */
.auth-right label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.32);
    margin-bottom: 6px;
}

.auth-right input,
.auth-right select {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    color: #e8e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    width: 100%;
    font-size: 13.5px;
    outline: none;
    font-family: var(--font-body);
    margin-bottom: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
    appearance: none;
}

.auth-right input::placeholder { color: rgba(255,255,255,0.18); }

.auth-right input:focus,
.auth-right select:focus {
    border-color: #6c63ff;
    background: rgba(108,99,255,0.06);
}

.auth-right select option { background: #1a1a2e; color: #e8e8f0; }

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

/* ── Auth buttons ────────────────────────────────────────── */
.btn-auth {
    width: 100%;
    padding: 11px;
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    margin-top: 6px;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.2px;
}

.btn-auth:hover   { background: #5a52e0; }
.btn-auth:active  { transform: scale(0.99); }
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Auth footer link ────────────────────────────────────── */
.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12.5px;
    color: rgba(255,255,255,0.22);
}

.auth-footer a {
    color: #6c63ff;
    font-weight: 500;
    text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

/* ── Auth messages ───────────────────────────────────────── */
.auth-error {
    background: rgba(192,57,43,0.12);
    border: 1px solid rgba(192,57,43,0.28);
    color: #e74c3c;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    margin-bottom: 16px;
    display: none;
}

.auth-success {
    background: rgba(26,122,74,0.12);
    border: 1px solid rgba(26,122,74,0.28);
    color: #2ecc71;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    margin-bottom: 16px;
    display: none;
}

/* ── Section divider inside register form ────────────────── */
.auth-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.18);
    margin: 20px 0 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Role extra fields toggle ────────────────────────────── */
.role-fields         { display: none; }
.role-fields.visible { display: block; }

/* ── Loading spinner inside button ───────────────────────── */
.btn-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}