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

/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --blue:         #1F66FF;
  --blue-dark:    #1450CC;
  --blue-glow:    rgba(31,102,255,0.18);

  --gold:         #C8A95A;
  --gold-light:   rgba(200,169,90,0.12);

  --midnight:     #080D14;
  --midnight-2:   #0F1620;
  --midnight-3:   #1A2333;

  --cream:        #F7F5F0;
  --parchment:    #EDE9E1;
  --white:        #FFFFFF;

  --ink:          #14110E;
  --stone-700:    #4A4845;
  --stone-500:    #8A8680;
  --stone-300:    #C8C4BE;
  --stone-200:    #E2E0DB;
  --stone-100:    #F0EDE8;

  --r-sm:  5px;
  --r:     9px;
  --r-lg:  13px;
  --r-xl:  18px;

  --sh-sm: 0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sh:    0 6px 20px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05);
  --sh-lg: 0 16px 40px rgba(0,0,0,.13), 0 6px 12px rgba(0,0,0,.07);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Jost', system-ui, sans-serif;
  --max: 1060px;
  --header-h: 60px;

  --z-sticky:   40;
  --z-nav:      48;
  --z-header:   50;
  --z-toast:    1000;
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Layout ──────────────────────────────────────────────── */
.wrap    { max-width: var(--max); margin: 0 auto; padding: 48px 28px; }
.wrap-sm { max-width: 480px;     margin: 0 auto; padding: 48px 24px; }
.wrap-md { max-width: 700px;     margin: 0 auto; padding: 40px 24px; }

/* ─── Typography ──────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--stone-200);
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  gap: 16px;
}

.site-header .logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  margin-left: 8px;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--stone-700);
  padding: 6px 11px;
  border-radius: var(--r-sm);
  transition: background 0.13s, color 0.13s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--stone-100); color: var(--ink); }
.nav-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.nav-link.active {
  background: var(--blue-glow);
  color: var(--blue);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-email {
  font-size: 12.5px;
  color: var(--stone-500);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-logout {
  background: none;
  border: 1.5px solid var(--stone-200);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--stone-700);
  cursor: pointer;
  padding: 5px 10px;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
  white-space: nowrap;
}
.header-logout:hover {
  background: var(--stone-100);
  border-color: var(--stone-300);
  color: var(--ink);
}
.header-logout:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: background 0.14s, border-color 0.14s, transform 0.12s, box-shadow 0.14s;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--blue-glow);
}

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--stone-200);
}
.btn-secondary:hover {
  border-color: var(--stone-300);
  background: var(--stone-100);
}

.btn-ghost-light {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  border-color: rgba(255,255,255,.14);
}
.btn-ghost-light:hover {
  background: rgba(255,255,255,.14);
  color: var(--white);
  border-color: rgba(255,255,255,.22);
}

.btn-danger {
  background: var(--white);
  color: #B91C1C;
  border-color: var(--stone-200);
}
.btn-danger:hover {
  background: #FEF2F2;
  border-color: #FECACA;
}

.btn-danger-solid {
  background: #B91C1C;
  color: var(--white);
  border-color: #B91C1C;
}
.btn-danger-solid:hover {
  background: #991B1B;
  border-color: #991B1B;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* ─── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  margin-bottom: 7px;
  color: var(--stone-700);
}

input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--stone-200);
  border-radius: var(--r);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.14s, box-shadow 0.14s;
  box-sizing: border-box;
  outline: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
input::placeholder, textarea::placeholder { color: var(--stone-300); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238A8680' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
  cursor: pointer;
}
textarea { resize: vertical; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1.5px solid var(--stone-200);
  border-radius: var(--r-lg);
  padding: 22px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.card:hover {
  border-color: var(--stone-300);
  box-shadow: var(--sh);
}

/* ─── Gold rule ───────────────────────────────────────────── */
.gold-rule {
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin: 12px 0 18px;
  border-radius: 2px;
}

/* ─── Meta text ───────────────────────────────────────────── */
.meta { color: var(--stone-500); font-size: 14px; margin-top: 3px; }

/* ─── Chips ───────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--stone-100);
  color: var(--stone-700);
  border: 1px solid var(--stone-200);
}
.chip-blue {
  background: var(--blue-glow);
  color: var(--blue);
  border-color: rgba(31,102,255,.22);
}

/* ─── Status badges ───────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.status-pending    { background: var(--stone-100); color: var(--stone-700); border-color: var(--stone-200); }
.status-viewed     { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.status-shortlisted { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.status-rejected   { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

/* ─── Status select ───────────────────────────────────────── */
/* Standalone — pairs only with a status-{state} color modifier; do not also apply .status-badge. */
.status-select {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 4px 28px 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  background-position: right 8px center;
  min-width: 0;
  width: auto;
}

/* ─── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: max(28px, calc(28px + env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  z-index: var(--z-toast);
  white-space: nowrap;
  animation: toastIn 0.25s cubic-bezier(.22,.68,0,1.15) both;
  pointer-events: none;
}
.toast.success::before { content: '✓  '; color: #6EE7B7; font-weight: 700; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Empty state box ─────────────────────────────────────── */
.empty-box {
  background: var(--white);
  border: 1.5px solid var(--stone-200);
  border-radius: var(--r-xl);
  padding: 52px 32px;
  text-align: center;
  margin-top: 8px;
}
.empty-box h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--ink);
}
.empty-box p { color: var(--stone-500); font-size: 14px; margin-bottom: 20px; }

/* ─── Error ───────────────────────────────────────────────── */
.err {
  color: #B91C1C;
  font-size: 14px;
  margin-top: 12px;
  padding: 11px 14px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--r-sm);
}

/* ─── Back link ──────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--stone-500);
  margin-bottom: 18px;
  transition: color 0.13s;
}
.back-link:hover { color: var(--ink); }
.back-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

/* ─── Page section heading ────────────────────────────────── */
.section-head {
  margin-bottom: 28px;
}
.section-head h1 { margin-bottom: 6px; }

/* ─── Divider ─────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--stone-200); margin: 32px 0; }

/* ─── Animations ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-1 { animation: fadeUp 0.5s cubic-bezier(.22,.68,0,1.15) both; }
.anim-2 { animation: fadeUp 0.5s cubic-bezier(.22,.68,0,1.15) 0.09s both; }
.anim-3 { animation: fadeUp 0.5s cubic-bezier(.22,.68,0,1.15) 0.18s both; }
.anim-4 { animation: fadeUp 0.5s cubic-bezier(.22,.68,0,1.15) 0.27s both; }

@media (prefers-reduced-motion: reduce) {
  .anim-1, .anim-2, .anim-3, .anim-4 { animation: none; }
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header { padding: 0 16px; }
  .header-email { display: none; }
  .site-nav { margin-left: 4px; }
  .nav-link { padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 640px) {
  .wrap, .wrap-sm, .wrap-md { padding: 24px 16px; }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.4rem; }
}
@media (max-width: 480px) {
  .site-nav { display: none; }
  .site-header { justify-content: space-between; }
}

/* ─── Screen-reader only ─────────────────────────────────── */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ─── Skip-link (a11y) ────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 16px;
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--r-sm) 0;
  transform: translateY(-110%);
  transition: transform 0.12s;
  z-index: 1000;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--white); outline-offset: -4px; }

/* ─── Skeleton loader ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--stone-100) 25%, var(--stone-200) 50%, var(--stone-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r);
  display: block;
}
.skeleton-card {
  background: var(--white);
  border: 1.5px solid var(--stone-200);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 10px;
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line-sm { height: 11px; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--stone-100); }
}

/* ─── Field error ─────────────────────────────────────────── */
.field-error { color: #B91C1C; font-size: 12px; margin-top: 4px; display: none; }
.field-error.visible { display: block; }
input.invalid, select.invalid, textarea.invalid {
  border-color: #FECACA;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

/* ─── Mobile hamburger ────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--stone-200);
  border-radius: var(--r-sm);
  padding: 4px 9px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.nav-mobile-menu {
  display: none;
  position: sticky;
  top: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--stone-200);
  padding: 8px 16px 14px;
  flex-direction: column;
  gap: 2px;
  z-index: var(--z-nav);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu .nav-link { padding: 10px 12px; display: block; }
@media (max-width: 480px) {
  .nav-toggle { display: block; }
}

/* ─── Nav unread badge ────────────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1;
  margin-left: 4px;
  vertical-align: middle;
}

/* ─── Button loading spinner ─────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading {
  opacity: 0.75;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}

/* ─── Saved chip variant ──────────────────────────────────── */
.chip-saved {
  background: #FEF9EC;
  color: var(--gold);
  border-color: rgba(200,169,90,0.4);
}
