/* ============================================
   ECS Application - style.css
   Palette: petrol #0F4C5C | marigold #E9A13B
            ink #1B2530   | mist #F4F6F8
   Type: Sora (headings) + Inter (body)
   ============================================ */

:root {
  --petrol: #0F4C5C;
  --petrol-dark: #0A3744;
  --marigold: #E9A13B;
  --marigold-soft: #FBF0DD;
  --ink: #1B2530;
  --slate: #5B6B7A;
  --line: #DDE4EA;
  --mist: #F4F6F8;
  --white: #FFFFFF;
  --danger: #C0392B;
  --success: #1E8E5A;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(15, 76, 92, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--mist);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, h4, .brand { font-family: 'Sora', 'Inter', sans-serif; }

a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border: none; border-radius: var(--radius);
  font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .18s, transform .12s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--petrol); color: var(--white); }
.btn-primary:hover { background: var(--petrol-dark); }
.btn-accent { background: var(--marigold); color: var(--ink); }
.btn-accent:hover { filter: brightness(1.05); }
.btn-outline { background: transparent; color: var(--petrol); border: 1.5px solid var(--petrol); }
.btn-outline:hover { background: var(--petrol); color: var(--white); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); padding: 7px 14px; font-size: 13px; }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* + icon button — the signature repeatable-section control */
.btn-add {
  width: 100%;
  padding: 12px;
  background: var(--marigold-soft);
  border: 1.5px dashed var(--marigold);
  border-radius: var(--radius);
  color: var(--petrol); font-family: 'Sora', sans-serif; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .18s;
}
.btn-add:hover { background: #F6E3C2; }
.btn-add .plus {
  display: inline-block; width: 22px; height: 22px; line-height: 21px;
  background: var(--marigold); color: var(--ink);
  border-radius: 50%; font-size: 16px; font-weight: 700;
  margin-right: 8px; text-align: center;
}

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--slate); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=number], input[type=password], input[type=file], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-family: inherit; font-size: 14px; color: var(--ink);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--petrol);
  box-shadow: 0 0 0 3px rgba(15, 76, 92, 0.12);
}
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.hint { font-size: 12.5px; color: var(--slate); margin-top: 5px; }

/* Autocomplete dropdown (shows only while typing) */
.ac-list {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 76, 92, 0.15);
  z-index: 60; max-height: 220px; overflow-y: auto;
}
.ac-item { padding: 10px 14px; font-size: 14px; cursor: pointer; }
.ac-item:hover { background: var(--marigold-soft); color: var(--petrol); font-weight: 600; }

/* OTP boxes */
.otp-row { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.otp-box {
  width: 48px; height: 54px;
  text-align: center; font-size: 22px; font-weight: 700; font-family: 'Sora', sans-serif;
  border: 1.5px solid var(--line); border-radius: var(--radius);
}
.otp-box:focus { border-color: var(--marigold); box-shadow: 0 0 0 3px rgba(233,161,59,.25); outline: none; }

/* Dev OTP box — stays visible until verified (DEV_MODE only) */
.dev-otp {
  background: var(--marigold-soft);
  border: 1.5px dashed var(--marigold);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  text-align: center;
}
.dev-otp strong { font-family: 'Sora', sans-serif; font-size: 20px; letter-spacing: 4px; color: var(--petrol); }
.dev-otp small { color: var(--slate); font-size: 11.5px; }

/* ---------- Auth pages (login / register) ---------- */
.auth-wrap { display: flex; min-height: 100vh; }
.auth-side {
  flex: 0 0 42%;
  background: linear-gradient(160deg, var(--petrol) 0%, var(--petrol-dark) 100%);
  color: var(--white);
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 56px;
  position: relative; overflow: hidden;
}
.auth-side::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 340px; height: 340px; border-radius: 50%;
  border: 56px solid rgba(233, 161, 59, 0.25);
}
.auth-side .brand { font-size: 30px; font-weight: 700; letter-spacing: .5px; margin-bottom: 14px; }
.auth-side .brand span { color: var(--marigold); }
.auth-side p { color: #CFE0E6; max-width: 380px; font-size: 15px; }
.auth-side ul { list-style: none; margin-top: 26px; }
.auth-side li { padding: 7px 0; color: #E6F0F3; font-size: 14px; }
.auth-side li::before { content: "—"; color: var(--marigold); margin-right: 10px; }

.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--slate); margin-bottom: 26px; font-size: 14px; }
.auth-switch { text-align: center; margin-top: 22px; font-size: 14px; color: var(--slate); }

/* Step panels in OTP flow */
.step { display: none; }
.step.active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- App header ---------- */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand { font-size: 20px; font-weight: 700; color: var(--petrol); }
.topbar .brand span { color: var(--marigold); }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a { font-size: 14px; font-weight: 600; color: var(--slate); }
.topbar nav a.active, .topbar nav a:hover { color: var(--petrol); text-decoration: none; }

/* ---------- Page layout ---------- */
.container { max-width: 980px; margin: 0 auto; padding: 34px 24px 70px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--slate); font-size: 14px; margin-top: 4px; }

/* Section cards */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to right, var(--white), var(--mist));
}
.card-head h3 { font-size: 16px; color: var(--petrol); }
.card-head .icon-add {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--marigold); color: var(--ink);
  border: none; font-size: 19px; font-weight: 700; line-height: 1;
  cursor: pointer; transition: transform .15s;
}
.card-head .icon-add:hover { transform: scale(1.12); }
.card-body { padding: 22px 24px; }

/* Dynamic repeatable rows (Post Resume form) */
.dyn-row {
  position: relative;
  border: 1px solid var(--line);
  border-left: 4px solid var(--marigold);
  border-radius: var(--radius);
  padding: 18px 18px 4px;
  margin-bottom: 14px;
  background: #FCFDFE;
}
.dyn-row .remove-row {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: #F3D9D5; color: var(--danger);
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.dyn-row .remove-row:hover { background: var(--danger); color: var(--white); }

/* Profile entry list (+ icon adds to these) */
.entry {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.entry:last-child { border-bottom: none; }
.entry h4 { font-size: 15px; }
.entry .meta { font-size: 13px; color: var(--slate); margin-top: 2px; }
.entry .del {
  border: none; background: none; color: var(--danger);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.entry .del:hover { text-decoration: underline; }

.skill-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--marigold-soft); border: 1px solid var(--marigold);
  color: var(--ink); border-radius: 30px;
  padding: 7px 14px; font-size: 13.5px; font-weight: 600;
}
.chip .x { cursor: pointer; color: var(--danger); font-weight: 700; }

.empty { color: var(--slate); font-size: 14px; font-style: italic; padding: 6px 0; }

/* ---------- Admin ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
.stat {
  background: var(--white); border: 1px solid var(--line);
  border-top: 4px solid var(--marigold);
  border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow);
}
.stat .num { font-family: 'Sora', sans-serif; font-size: 30px; font-weight: 700; color: var(--petrol); }
.stat .lbl { font-size: 13px; color: var(--slate); font-weight: 600; margin-top: 2px; }

.filter-bar { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px; margin-bottom: 20px; }

table.data { width: 100%; border-collapse: collapse; background: var(--white); }
table.data th {
  text-align: left; font-family: 'Sora', sans-serif; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--slate); background: var(--mist);
  padding: 12px 16px; border-bottom: 1.5px solid var(--line);
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
table.data tr:hover td { background: #FAFBFC; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.active { background: #DFF3E8; color: var(--success); }
.badge.inactive { background: #F6E0DC; color: var(--danger); }

/* Recruitment status badge (candidate dashboard) */
.rs-badge { padding: 9px 20px; border-radius: 30px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 14px; background: #E8EDF2; color: #5B6B7A; }
.rs-badge[data-rs="New"]                 { background: #E8EDF2; color: #5B6B7A; }
.rs-badge[data-rs="Under Review"]        { background: #FBF0DD; color: #9A6A14; }
.rs-badge[data-rs="Shortlisted"]         { background: #DDEBF9; color: #1D5FA8; }
.rs-badge[data-rs="Interview Scheduled"] { background: #E9E2F7; color: #5B3FA8; }
.rs-badge[data-rs="Selected"]            { background: #DFF3E8; color: #1E8E5A; }
.rs-badge[data-rs="Rejected"]            { background: #F6E0DC; color: #C0392B; }
.rs-badge[data-rs="On Hold"]             { background: #F2EFE5; color: #7A6E45; }
.rs-select { width: auto; padding: 7px 10px; font-size: 13px; }

.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 150px; }
.act-btn {
  display: inline-block; text-align: center;
  padding: 6px 8px; border-radius: 7px;
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s; text-decoration: none;
}
.act-btn:hover { text-decoration: none; }
.act-view   { background: #E7EEF1; color: #0A3744; }
.act-view:hover { background: var(--petrol); color: #fff; }
.act-resume { background: #E7EEF1; color: #0A3744; }
.act-resume:hover { background: var(--petrol); color: #fff; }
.act-toggle { background: #F8E5E1; color: #8A1F12; }
.act-toggle:hover { background: var(--danger); color: #fff; }
.act-delete { background: #F8E5E1; color: #8A1F12; }
.act-delete:hover { background: var(--danger); color: #fff; }
.act-update { background: #0A3744; color: #ffffff; }
.act-update:hover { background: #0F4C5C; color: #ffffff; }

.link-btn { background: none; border: none; color: var(--petrol); font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.red { color: var(--danger); }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(27, 37, 48, 0.55);
  z-index: 100; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: 14px;
  width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  animation: fadeUp .22s ease;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--white);
}
.modal-head h3 { font-size: 17px; color: var(--petrol); }
.modal-close { background: none; border: none; font-size: 22px; color: var(--slate); cursor: pointer; }
.modal-body { padding: 22px 24px; }
.modal-section { margin-bottom: 18px; }
.modal-section h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--marigold); margin-bottom: 8px;
  border-bottom: 1px dashed var(--line); padding-bottom: 5px;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: var(--white);
  padding: 13px 26px; border-radius: 30px;
  font-size: 14px; font-weight: 600;
  opacity: 0; transition: all .3s ease; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); }
#toast.success { background: var(--success); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth-side { display: none; }
  .form-row, .form-row-3, .stats-grid, .filter-bar { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .container { padding: 24px 14px 60px; }
  table.data { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}