/* ══════════════════════════════════════════════════════════════════════
   OneApply — Shared Design System
   ══════════════════════════════════════════════════════════════════════ */

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

/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  --ink:        #0f172a;
  --ink2:       #1e293b;
  --text:       #475569;
  --muted:      #94a3b8;
  --border:     #e2e8f0;
  --border2:    #cbd5e1;
  --bg:         #ffffff;
  --bg2:        #f8fafc;
  --bg3:        #f1f5f9;
  --blue:       #2563eb;
  --blue-d:     #1d4ed8;
  --blue-l:     #eff6ff;
  --blue-b:     #bfdbfe;
  --green:      #059669;
  --green-l:    #ecfdf5;
  --red:        #dc2626;
  --red-l:      #fef2f2;
  --amber:      #d97706;
  --amber-l:    #fffbeb;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --shadow:     0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.06);
  --shadow-md:  0 4px 12px rgba(15,23,42,.08);
  --shadow-lg:  0 12px 32px rgba(15,23,42,.1);
  --font:       'DM Sans', sans-serif;
  --font-serif: 'DM Serif Display', serif;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Navbar ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-logo {
  font-size: 18px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.nav-logo-dot { width: 8px; height: 8px; background: var(--blue); border-radius: 50%; }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--text);
  padding: 7px 12px; border-radius: 8px; transition: all .15s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--ink); background: var(--bg2); }
.nav-link.active { font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; padding: 6px 10px; border-radius: 8px; transition: background .15s; }
.nav-user:hover { background: var(--bg2); }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.nav-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.nav-badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 100px; }
@media(max-width: 768px) {
  .nav-links { display: none; }
  .nav-link-text { display: none; }
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: var(--radius); border: none; transition: all .15s; cursor: pointer; white-space: nowrap; }
.btn-sm { font-size: 13px; padding: 7px 14px; }
.btn-lg { font-size: 15px; padding: 12px 24px; }
.btn-xl { font-size: 16px; padding: 14px 32px; border-radius: 10px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink2); transform: translateY(-1px); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-d); transform: translateY(-1px); }
.btn-ghost { background: var(--bg); color: var(--ink); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--border2); background: var(--bg2); }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue-l); }
.btn-danger { background: var(--red-l); color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: var(--green-l); color: var(--green); border: 1px solid #a7f3d0; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-size: 14px; color: var(--ink); background: var(--bg);
  outline: none; transition: border-color .15s;
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.form-input.error { border-color: var(--red); }
.form-input::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; display: none; }
.form-error.show { display: block; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; transition: color .15s; }
.pw-toggle:hover { color: var(--ink); }

/* ── Alert / Toast ──────────────────────────────────────────────────── */
.alert { border-radius: var(--radius); padding: 12px 16px; font-size: 14px; font-weight: 500; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--red-l); color: var(--red); border: 1px solid #fecaca; }
.alert-success { background: var(--green-l); color: var(--green); border: 1px solid #a7f3d0; }
.alert-info { background: var(--blue-l); color: var(--blue); border: 1px solid var(--blue-b); }
.alert-warning { background: var(--amber-l); color: var(--amber); border: 1px solid #fde68a; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.card-sm { padding: 14px 16px; border-radius: var(--radius); }
.card-hover { transition: all .2s; }
.card-hover:hover { border-color: var(--border2); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 100px; }
.badge-blue { background: var(--blue-l); color: var(--blue); }
.badge-green { background: var(--green-l); color: var(--green); }
.badge-red { background: var(--red-l); color: var(--red); }
.badge-amber { background: var(--amber-l); color: var(--amber); }
.badge-gray { background: var(--bg3); color: var(--text); }
.badge-ink { background: var(--ink); color: #fff; }

/* ── Tags / Skills ──────────────────────────────────────────────────── */
.tag { display: inline-block; font-size: 12px; font-weight: 500; background: var(--bg2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 100px; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Status pills ───────────────────────────────────────────────────── */
.status-applied   { background: var(--blue-l);   color: var(--blue);  border-radius: 100px; font-size: 12px; font-weight: 600; padding: 3px 10px; }
.status-interview { background: var(--amber-l);  color: var(--amber); border-radius: 100px; font-size: 12px; font-weight: 600; padding: 3px 10px; }
.status-offer     { background: var(--green-l);  color: var(--green); border-radius: 100px; font-size: 12px; font-weight: 600; padding: 3px 10px; }
.status-rejected  { background: var(--red-l);    color: var(--red);   border-radius: 100px; font-size: 12px; font-weight: 600; padding: 3px 10px; }

/* ── Avatar ─────────────────────────────────────────────────────────── */
.avatar { border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar-sm  { width: 32px;  height: 32px;  font-size: 12px; }
.avatar-md  { width: 44px;  height: 44px;  font-size: 16px; }
.avatar-lg  { width: 64px;  height: 64px;  font-size: 22px; }
.avatar-xl  { width: 96px;  height: 96px;  font-size: 32px; }
.avatar-ink { background: var(--ink); color: #fff; }
.avatar-blue { background: var(--blue); color: #fff; }
.avatar-gradient { background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; }

/* ── Spinner ─────────────────────────────────────────────────────────── */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; display: none; }
.spinner.show { display: block; }
.spinner-dark { border-color: rgba(15,23,42,.15); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page layout ─────────────────────────────────────────────────────── */
.page { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; }
.page-sm  { max-width: 640px; }
.page-md  { max-width: 900px; }
.page-two { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
@media(max-width: 900px) { .page-two { grid-template-columns: 1fr; } }
.page-title { font-family: var(--font-serif); font-size: clamp(24px, 4vw, 36px); color: var(--ink); letter-spacing: -.5px; margin-bottom: 4px; }
.page-subtitle { font-size: 15px; color: var(--muted); margin-bottom: 28px; }

/* ── Section ─────────────────────────────────────────────────────────── */
.section-tag { font-size: 12px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.section-title { font-family: var(--font-serif); font-size: clamp(24px, 4vw, 40px); color: var(--ink); letter-spacing: -.5px; line-height: 1.15; margin-bottom: 12px; }

/* ── Sidebar nav ─────────────────────────────────────────────────────── */
.sidebar { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; position: sticky; top: 80px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text); padding: 10px 12px; border-radius: var(--radius); transition: all .15s; }
.sidebar-link:hover, .sidebar-link.active { background: var(--bg2); color: var(--ink); }
.sidebar-link.active { font-weight: 600; background: var(--blue-l); color: var(--blue); }
.sidebar-link svg { flex-shrink: 0; opacity: .6; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ── Job cards ──────────────────────────────────────────────────────── */
.job-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: all .2s; cursor: pointer; }
.job-card:hover { border-color: var(--border2); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.job-card.selected { border-color: var(--blue); background: var(--blue-l); }
.job-card.featured { border-left: 3px solid var(--blue); }
.job-logo { width: 44px; height: 44px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; overflow: hidden; }
.job-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.job-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.job-company { font-size: 13px; color: var(--text); }
.job-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.job-meta-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.job-salary { font-size: 13px; font-weight: 600; color: var(--green); }

/* ── Profile card ─────────────────────────────────────────────────────── */
.profile-header-banner { background: var(--ink); height: 80px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.profile-body { padding: 0 24px 24px; }
.profile-avatar-wrap { margin-top: -32px; margin-bottom: 12px; }
.profile-name { font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.profile-headline { font-size: 14px; color: var(--text); margin-bottom: 12px; }
.open-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--green-l); color: var(--green); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 100px; }
.open-badge::before { content: ''; width: 6px; height: 6px; background: var(--green); border-radius: 50%; }

/* ── Chat ────────────────────────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 65px); overflow: hidden; }
@media(max-width: 768px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-sidebar { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-conv-item { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.chat-conv-item:hover, .chat-conv-item.active { background: var(--bg2); }
.chat-conv-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.chat-conv-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.chat-main { display: flex; flex-direction: column; }
.chat-topbar { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: var(--bg); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--bg2); }
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.me { flex-direction: row-reverse; }
.bubble { max-width: 70%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.bubble-them { background: var(--bg); border: 1px solid var(--border); color: var(--ink); border-bottom-left-radius: 4px; }
.bubble-me { background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 2px; }
.me .msg-time { text-align: right; }
.chat-input-area { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; background: var(--bg); }
.chat-input { flex: 1; border: 1.5px solid var(--border); border-radius: 24px; padding: 10px 16px; font-size: 14px; outline: none; resize: none; max-height: 120px; }
.chat-input:focus { border-color: var(--blue); }
.chat-send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); border: none; color: #fff; font-size: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

/* ── ATS Score ring ──────────────────────────────────────────────────── */
.ats-ring { position: relative; width: 80px; height: 80px; }
.ats-ring svg { transform: rotate(-90deg); }
.ats-ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.ats-ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ats-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ats-score-num { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1; }
.ats-score-pct { font-size: 10px; color: var(--muted); }

/* ── Resume preview ──────────────────────────────────────────────────── */
.resume-preview { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; font-size: 13px; line-height: 1.6; max-height: 600px; overflow-y: auto; }
.resume-name { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.resume-contact { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.resume-hr { border: none; border-top: 1.5px solid var(--ink); margin: 10px 0; }
.resume-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: 8px; }
.resume-exp-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.resume-exp-title { font-weight: 700; color: var(--ink); font-size: 13px; }
.resume-exp-date { font-size: 12px; color: var(--muted); }
.resume-exp-company { font-size: 12px; color: var(--text); margin-bottom: 4px; }
.resume-bullets { padding-left: 16px; }
.resume-bullets li { margin-bottom: 2px; font-size: 12px; color: var(--text); }
.resume-skills-list { display: flex; flex-wrap: wrap; gap: 4px; }
.resume-skill { background: var(--bg2); border: 1px solid var(--border); font-size: 11px; padding: 2px 8px; border-radius: 4px; color: var(--text); }

/* ── Mobile menu ─────────────────────────────────────────────────────── */
.mobile-menu { display: none; position: fixed; inset: 0; z-index: 300; background: var(--bg); flex-direction: column; }
.mobile-menu.open { display: flex; }
.mobile-menu-top { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.mobile-menu-links { padding: 16px; flex: 1; overflow-y: auto; }
.mobile-menu-link { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; color: var(--ink); padding: 12px 14px; border-radius: var(--radius); }
.mobile-menu-link:hover { background: var(--bg2); }
.mobile-menu-footer { padding: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }

/* ── Tabs ────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; background: var(--bg2); border-radius: var(--radius); padding: 4px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text); background: transparent; border: none; border-radius: 8px; transition: all .15s; }
.tab-btn.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }

/* ── Progress bar ────────────────────────────────────────────────────── */
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width .4s ease; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty-desc { font-size: 14px; color: var(--muted); max-width: 280px; margin: 0 auto 20px; line-height: 1.6; }

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 500; padding: 20px; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg); border-radius: var(--radius-xl); padding: 28px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-title { font-family: var(--font-serif); font-size: 22px; color: var(--ink); margin-bottom: 4px; }
.modal-close { position: absolute; top: 16px; right: 16px; background: var(--bg2); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; color: var(--muted); }

/* ── Utilities ───────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media(max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-20{margin-top:20px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.mb-4{margin-bottom:4px}.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}.mb-20{margin-bottom:20px}.mb-24{margin-bottom:24px}
.text-sm { font-size: 13px; } .text-xs { font-size: 12px; }
.text-muted { color: var(--muted); } .text-ink { color: var(--ink); } .text-blue { color: var(--blue); }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.sticky-top { position: sticky; top: 80px; }
