/* StarWebX Hiring: premium brand tokens (midnight navy, royal blue, sky, gold accent) and shared components. Mobile-first. */
:root {
  --navy: #0a1f44;
  --primary: #1a56db;
  --primary-dark: #1446b8;
  --primary-soft: #ebf1fe;
  --sky: #38bdf8;
  --gold: #c9a043;
  --gold-soft: #fbf4e2;
  --gradient: linear-gradient(135deg, #0a1f44 0%, #1a56db 62%, #38bdf8 100%);
  --btn-gradient: linear-gradient(180deg, #2563eb 0%, #1a56db 100%);
  --hero-bg: radial-gradient(520px 260px at 92% -10%, rgba(56, 189, 248, .45), transparent 65%), radial-gradient(420px 240px at -5% 110%, rgba(201, 160, 67, .28), transparent 60%), linear-gradient(160deg, #071631 0%, #0d2a5e 55%, #1a4fc4 100%);
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --text: #0b1730;
  --muted: #4a5873;
  --faint: #8a97ac;
  --success: #0f8a5f;
  --success-soft: #e3f6ee;
  --warning: #b86e00;
  --warning-soft: #fff4e0;
  --danger: #d1343d;
  --danger-soft: #fdecee;
  --info: #1565d8;
  --info-soft: #eaf2fe;
  --sk-base: #e6ecf4;
  --sk-shine: #f4f7fb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 31, 68, .04), 0 4px 12px rgba(10, 31, 68, .05), 0 16px 40px -12px rgba(10, 31, 68, .10);
  --shadow-lg: 0 24px 60px -12px rgba(10, 31, 68, .30);
  --focus: 0 0 0 3px rgba(26, 86, 219, .25);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --tap: 44px;
  color-scheme: light;
}

/* Always light: the form must stay readable even when the device is in dark mode. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; font-family: var(--font-head); }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--tap); padding: .6rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent; font: 600 .92rem/1.2 var(--font); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--btn-gradient); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 18px -4px rgba(26, 86, 219, .55); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 24px -6px rgba(26, 86, 219, .6); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 36px; padding: .4rem .75rem; font-size: .82rem; }
.btn-icon { min-height: 40px; width: 40px; padding: 0; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font: 600 .85rem var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Form fields: 16px inputs stop iOS from zooming on focus */
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > label, .field-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.req::after { content: ' *'; color: var(--danger); }
.input, .select, .textarea { width: 100%; min-height: var(--tap); padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 400 16px/1.4 var(--font); transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.textarea { min-height: 88px; resize: vertical; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea, .field.invalid .dropzone { border-color: var(--danger); }
.error { color: var(--danger); font-size: .78rem; }
.error:empty { display: none; }
.hint { color: var(--faint); font-size: .76rem; }
.grid { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; } .span-all { grid-column: 1 / -1; } }

/* Input with a fixed prefix (country code) */
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.input-group:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.input-group .input { border: 0; box-shadow: none; min-width: 0; }
.input-prefix { display: inline-flex; align-items: center; gap: .4rem; padding: 0 .7rem; border-right: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--text); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.input-prefix .flag { width: 20px; height: 14px; border-radius: 3px; background: linear-gradient(180deg, #ff9933 0 33.3%, #ffffff 33.3% 66.6%, #138808 66.6%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.field.invalid .input-group, .field.invalid .tag-input { border-color: var(--danger); }

/* Tag input */
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-height: var(--tap); padding: .35rem .45rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: text; transition: border-color .15s, box-shadow .15s; }
.tag-input:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.tag { display: inline-flex; align-items: center; gap: .2rem; padding: .25rem .3rem .25rem .6rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .84rem; font-weight: 600; animation: tag-in .15s ease; }
.tag-remove { border: 0; background: none; color: inherit; width: 22px; height: 22px; border-radius: 50%; font-size: 1rem; line-height: 1; cursor: pointer; opacity: .7; }
.tag-remove:hover { opacity: 1; background: rgba(26, 86, 219, .12); }
.tag-entry:focus-visible { box-shadow: none; }
.tag-entry { flex: 1; min-width: 120px; border: 0; outline: none; background: none; color: var(--text); font: 400 16px/1.4 var(--font); padding: .25rem .3rem; }
@keyframes tag-in { from { transform: scale(.85); opacity: 0; } }

/* Choice pills (radio / checkbox) */
.choices { display: flex; flex-wrap: wrap; gap: .45rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.choice span { display: inline-flex; align-items: center; min-height: 40px; padding: .45rem .85rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .86rem; font-weight: 500; transition: all .15s; }
.choice span::before { content: ''; width: 0; overflow: hidden; transition: width .15s; }
.choice input:checked + span { border-color: var(--primary); background: var(--btn-gradient); color: #fff; font-weight: 600; box-shadow: 0 4px 12px -4px rgba(26, 86, 219, .5); }
.choice input:checked + span::before { content: '\2713'; width: auto; margin-right: .1rem; }
.choice span:hover { border-color: var(--primary); }
.choice input:disabled { cursor: not-allowed; }
.choice input:disabled + span { opacity: .45; background: var(--surface-2); border-style: dashed; }
.choice input:disabled + span:hover { border-color: var(--border); }
.choice input:focus-visible + span { box-shadow: var(--focus); }

/* Cards and badges */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.badge { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-strong, .badge-selected { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-good, .badge-shortlisted, .badge-interview { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-average, .badge-on_hold, .badge-reviewed { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-low, .badge-rejected { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-new { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* Progress bar */
.progress { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--gradient); border-radius: 6px; transition: width .35s ease; }
.progress-lg { height: 10px; }

/* Skeleton loading */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--sk-base) 25%, var(--sk-shine) 50%, var(--sk-base) 75%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
.sk-line { height: 12px; margin: .55rem 0; }
.sk-line.lg { height: 18px; }
.w-25 { width: 25%; } .w-40 { width: 40%; } .w-60 { width: 60%; } .w-90 { width: 90%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Toasts */
.toast-wrap { position: fixed; z-index: 1000; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
@media (min-width: 640px) { .toast-wrap { left: auto; right: 20px; bottom: 20px; width: 380px; } }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .65rem; padding: .75rem .75rem .75rem .9rem; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--info); box-shadow: var(--shadow-lg); font-size: .88rem; animation: toast-in .22s ease; }
.toast.leaving { animation: toast-out .2s ease forwards; }
.toast-icon { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; color: var(--info); }
.toast-body { flex: 1; min-width: 0; }
.toast-body strong { display: block; font-size: .88rem; margin-bottom: .1rem; }
.toast-body p { color: var(--muted); }
.toast-close { flex: none; border: 0; background: none; color: var(--faint); font-size: 1.3rem; line-height: 1; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; }
.toast-close:hover { background: var(--surface-2); color: var(--text); }
.toast-success { border-left-color: var(--success); } .toast-success .toast-icon { color: var(--success); }
.toast-error { border-left-color: var(--danger); } .toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); } .toast-warning .toast-icon { color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* Modal overlay */
.overlay { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(6, 15, 34, .55); backdrop-filter: blur(3px); }
.overlay-box { width: min(420px, 100%); padding: 1.5rem 1.25rem; text-align: center; box-shadow: var(--shadow-lg); }
.overlay-box h2 { font-size: 1.1rem; }
.overlay-stage { color: var(--muted); font-size: .9rem; margin: .4rem 0 1rem; min-height: 1.4em; }
.overlay-meta { display: flex; justify-content: space-between; margin-top: .5rem; font-size: .78rem; color: var(--faint); }
.overlay-meta span:first-child { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

.spinner { width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--text); text-decoration: none; font-size: 1rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; background: #fff; padding: 3px; }
.brand b { color: var(--primary); }
.brand-light { color: #fff; }
.brand-light b { color: var(--gold); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }
