/* ═══════════════════════════════════════════════════════════════════════════
   BHire — Design Tokens + Shared Components
   Imported by every page. Do not put page-specific rules here.
═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg:            #F5F4EF;
  --bg-card:       #FFFFFF;
  --text:          #1A1A1A;
  --text-muted:    #6B6B6B;
  --accent:        #1C3557;
  --accent-hover:  #254A78;
  --border:        #E2E0D9;
  --border-strong: #C6C3BB;
  --success:       #1A6E3C;
  --error:         #B91C1C;
  --warn:          #92400E;
  --dark-bg:       #0F0F0E;
  --dark-text:     #E8E6DF;

  --font-serif:    'Playfair Display', Georgia, serif;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --r:   10px;
  --r-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 32px rgba(0,0,0,0.08);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font-sans);
  font-size:   16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font-sans); }
a { color: inherit; }

/* ── Typography helpers ─────────────────────────────────────────────────── */
.serif { font-family: var(--font-serif); }
.muted { color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover:not(:disabled) { background: var(--accent); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text); background: rgba(0,0,0,0.04); }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── Form inputs ─────────────────────────────────────────────────────────── */
.f-group {
  margin-bottom: 18px;
}
.f-group:last-of-type { margin-bottom: 0; }

.f-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.f-input,
.f-select,
.f-textarea {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 14.5px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
  appearance: none;
  -webkit-appearance: none;
}
.f-input::placeholder,
.f-textarea::placeholder { color: var(--text-muted); }
.f-input:focus,
.f-select:focus,
.f-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28,53,87,0.07);
}
.f-input.invalid,
.f-select.invalid { border-color: var(--error); }

/* Select arrow */
.f-select-wrap { position: relative; }
.f-select-wrap::after {
  content: '↓';
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.f-error {
  display: none;
  font-size: 12px;
  color: var(--error);
  margin-top: 5px;
}
.f-error.show { display: block; }

.f-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Inline input + button (e.g. password visibility toggle) */
.f-input-wrap { position: relative; }
.f-input-wrap .f-input { padding-right: 56px; }
.f-input-action {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.2s;
}
.f-input-action:hover { color: var(--accent); }

/* Checkbox */
.f-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.f-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.f-check a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }

/* Two-col form grid */
.f-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 520px) { .f-row { grid-template-columns: 1fr; } }

/* ── Form banner (success / error message strip) ─────────────────────────── */
.form-banner {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.form-banner[hidden] { display: none; }
.form-banner--success { background: #EDFAF3; color: var(--success); border: 1px solid #A3E3BF; }
.form-banner--error   { background: #FEF2F2; color: var(--error);   border: 1px solid #FECACA; }

/* ── Toast (floating notification) ─────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 320px;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.success { background: var(--success); }
#toast.error   { background: var(--error); }

/* ── Loading dots ─────────────────────────────────────────────────────────── */
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.loading-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: ldot 1.1s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.loading-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes ldot {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1;   }
}

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 20px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
