/* ============================================================
   Steel D Link — Real-Time Modern Form UI
   ============================================================ */

:root {
  color-scheme: light;
  
  /* Modern SaaS Palette */
  --bg-body:       #f3f4f6;
  --surface:       #ffffff;
  --surface-hover: #f9fafb;
  
  --primary:       #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --navy-900:      #0f172a;
  --navy-800:      #1e293b;
  --navy-700:      #334155;
  
  --text:          #111827;
  --text-muted:    #4b5563;
  --text-subtle:   #9ca3af;

  --border:        #e5e7eb;
  --border-strong: #d1d5db;

  --ok-bg:  #ecfdf5;  --ok-fg:  #047857;  --ok-border:  #a7f3d0;
  --warn-bg:#fffbeb;  --warn-fg:#b45309;  --warn-border:#fde68a;
  --err-bg: #fef2f2;  --err-fg: #b91c1c;  --err-border: #fecaca;

  /* Radii & Shadows */
  --radius-lg: 16px;
  --radius:    10px;
  --radius-sm: 6px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
background: #833AB4;
background: linear-gradient(90deg,#a855d4 0%, rgb(148, 79, 228) 50%, rgb(150, 85, 224) 100%);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
:focus-visible { outline: none; }

/* ============================================================
   HEADER (Sleek & Sticky)
   ============================================================ */
.site-header { 
  background: rgba(15, 23, 42, 0.95); 
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff; 
  position: sticky; 
  top: 0; 
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.site-header__inner { 
  max-width: 950px; 
  margin: 0 auto; 
  padding: 12px 24px; 
  display: flex; 
  align-items: center; 
  gap: 20px; 
  flex-wrap: wrap; 
}

.brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.brand img { height: 38px; width: auto; border-radius: var(--radius-sm); }

.header-title { flex: 1 1 260px; min-width: 0; }
.header-title h1 { 
  font-size: 25px; 
  font-weight: 600; 
  text-align: center; 
  letter-spacing: -0.01em; 
  line-height: 1.3; 
  color: #ffffff; 
  margin: 0; 
}
.header-title p { margin: 2px 0 0; font-size: 12px; color: #94a3b8; }

.staff-box { display: flex; align-items: center; gap: 12px; flex: none; }
.staff-box form { margin: 0; }

.staff-chip { 
  display: flex; 
  flex-direction: column; 
  line-height: 1.2; 
  padding: 6px 14px; 
  border-radius: var(--radius); 
  background: rgba(255,255,255,0.05); 
  border: 1px solid rgba(255,255,255,0.1); 
}
.staff-chip strong { font-size: 12px; font-weight: 600; color: #fff; }
.staff-chip small { font-size: 10px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: #94a3b8; margin-top: 2px; }

.staff-box .secondary { 
  background: rgba(255,255,255,0.1); 
  color: #fff; 
  border: 1px solid rgba(255,255,255,0.15); 
  box-shadow: none; 
  padding: 8px 16px; 
  font-size: 13px; 
}
.staff-box .secondary:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); }

.brand-bar { display: none; /* Replaced by border-bottom */ }

/* ============================================================
   LAYOUT & CARDS
   ============================================================ */
main { max-width: 650px; margin: 32px auto; padding: 0 20px; }
footer { text-align: center; color: var(--text-subtle); padding: 22px 15px; font-size: 13px; }

.card { 
  background: var(--surface); 
  border: 1px solid var(--border); 
  border-radius: var(--radius-lg); 
  padding: 20px; 
  margin-bottom: 5px; 
  box-shadow: var(--shadow-md); 
  transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: var(--shadow-lg); }

/* Specific top accent for the first card */
main > .card:first-child,
main > form > .card:first-child {
  border-top: 4px solid var(--primary);
}

h2 { 
  font-size: 20px; 
  font-weight: 700; 
  letter-spacing: -0.02em; 
  color: var(--navy-900); 
  margin: 0 0 20px; 
  padding-bottom: 16px; 
  border-bottom: 1px solid var(--border); 
}

h3 { font-size: 16px; font-weight: 600; color: var(--navy-800); margin: 24px 0 16px; }

/* ============================================================
   FORMS (Interactive & Clean)
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.full, .wide { grid-column: 1 / -1; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--navy-800); margin-bottom: 8px; }

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  font-family: inherit;
  font-size: 14px; 
  width: 100%; 
  padding: 12px 16px; 
  border: 1.5px solid var(--border-strong); 
  border-radius: var(--radius); 
  background: var(--surface); 
  color: var(--text); 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
  min-height: 44px;
  box-shadow: var(--shadow-sm);
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover { border-color: var(--text-subtle); }

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus { 
  outline: none; 
  border-color: var(--primary); 
  box-shadow: var(--shadow-focus); 
  background: #fff;
}

textarea { min-height: 100px; resize: vertical; line-height: 1.6; }

select { 
  appearance: none; 
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M4 6l4 4 4-4'/%3e%3c/svg%3e"); 
  background-repeat: no-repeat; 
  background-position: right 14px center; 
  background-size: 16px; 
  padding-right: 40px; 
  cursor: pointer; 
}

input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; cursor: pointer; }

/* Radio Buttons & Checkboxes (Modern Toggle style) */
.choices { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 0; }
.choices label { 
  display: inline-flex; 
  align-items: center; 
  gap: 10px; 
  padding: 10px 20px; 
  border: 1.5px solid var(--border-strong); 
  border-radius: var(--radius); 
  background: var(--surface); 
  font-weight: 500; 
  font-size: 14px; 
  color: var(--text-muted); 
  margin: 0; 
  cursor: pointer; 
  transition: all 0.2s ease; 
  box-shadow: var(--shadow-sm);
}
.choices label:hover { border-color: var(--primary); background: var(--surface-hover); }
.choices label:has(input:checked) { 
  border-color: var(--primary); 
  background: var(--primary-light); 
  color: var(--primary-hover); 
  font-weight: 600; 
  box-shadow: 0 0 0 1px var(--primary);
}

.help { font-size: 13px; color: var(--text-muted); margin: 8px 0 0; line-height: 1.5; }
.hidden { display: none !important; }

.reference { 
  display: grid; 
  grid-template-columns: 1fr 1fr auto; 
  gap: 16px; 
  align-items: end; 
  margin-bottom: 16px; 
  padding: 20px; 
  background: var(--surface-hover); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
}

/* ============================================================
   BUTTONS (Dynamic & Clickable)
   ============================================================ */
button, .button { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px; 
  border: 0; 
  border-radius: var(--radius); 
  background: var(--primary); 
  color: #fff; 
  font: inherit; 
  font-weight: 600; 
  font-size: 14px; 
  padding: 12px 24px; 
  cursor: pointer; 
  text-decoration: none; 
  transition: all 0.2s ease; 
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -1px rgba(37, 99, 235, 0.1); 
}
button:hover, .button:hover { 
  background: var(--primary-hover); 
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3), 0 4px 6px -1px rgba(37, 99, 235, 0.1); 
}
button:active, .button:active { transform: translateY(1px); box-shadow: none; }

.secondary { background: var(--surface); color: var(--navy-800); border: 1.5px solid var(--border-strong); box-shadow: var(--shadow-sm); }
.secondary:hover { background: var(--surface-hover); border-color: var(--text-subtle); }

.danger { background: var(--err-fg); box-shadow: 0 4px 6px -1px rgba(185, 28, 28, 0.2); }
.danger:hover { background: #991b1b; }

.actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 32px; }

/* ============================================================
   NOTICES & ERROR BANNERS
   ============================================================ */
.notice, .error { padding: 16px; border-radius: var(--radius); margin-bottom: 24px; font-size: 14px; font-weight: 500; border-left: 4px solid; box-shadow: var(--shadow-sm); }
.notice { background: var(--ok-bg); color: var(--ok-fg); border-left-color: #10b981; }
.error { background: var(--err-bg); color: var(--err-fg); border-left-color: #ef4444; }

/* ============================================================
   TABLES (Admin Dashboard Style)
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: var(--surface-hover); font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--surface-hover); }

.candidate-name { display: block; font-size: 14px; font-weight: 600; color: var(--navy-900); margin-bottom: 4px; }
.candidate-contact { font-size: 13px; color: var(--text-muted); }
.candidate-contact span { display: block; }

.personal-details { min-width: 180px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.personal-details strong { color: var(--navy-700); font-weight: 600; }

.approval-cell { white-space: nowrap; }
.applications-table th:last-child, .applications-table td:last-child { text-align: right; vertical-align: middle; }
.applications-table td a.button { padding: 8px 16px; font-size: 13px; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--warn-bg); color: var(--warn-fg); border: 1px solid var(--warn-border); }
.status-approved { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-border); }
.status-rejected { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-border); }

/* ============================================================
   DETAILS GRID & LOGIN
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-grid p { margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-hover); font-size: 14px; line-height: 1.5; }
.detail-grid strong { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.detail-grid .wide { grid-column: 1 / -1; }

.login { max-width: 440px; margin: 60px auto; padding: 40px; box-shadow: var(--shadow-lg); }
.login h2 { justify-content: center; text-align: center; border-bottom: 0; padding-bottom: 0; margin-bottom: 24px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .site-header__inner { padding: 12px 16px; gap: 12px; }
  .brand img { height: 32px; }
  .header-title { flex-basis: 100%; order: 3; text-align: center; }
  .header-title h1 { font-size: 16px; text-align: center; }
  .staff-box { order: 2; margin-left: auto; }
  
  main { padding: 0 16px; margin: 20px auto; }
  .grid, .detail-grid { grid-template-columns: 1fr; }
  .full, .wide { grid-column: auto; }
  .card { padding: 20px; }
  .reference { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .actions > * { flex: 1 1 100%; justify-content: center; }
  .login { margin: 32px auto; padding: 24px; }
}