/* ===========================================================
   Iconic Services — MANAGER Portal
   Shared stylesheet for the hub + all forms
   Brand palette taken from the Iconic logo
   (Same dark-blue branding as the Employee portal.)
   =========================================================== */
:root {
  --blue: #2942A8;
  --blue-dark: #1E3380;
  --blue-light: #E8ECF7;
  --teal: #4A90C2;
  --teal-dark: #2E6A98;
  --teal-light: #E5F0F8;
  --charcoal: #3A3A3A;
  --white: #FFFFFF;
  --cream: #F8F9FC;
  --border: #DDE2EC;
  --text: #1A1F2E;
  --text-soft: #4A5060;
  --grey: #6B7280;
  --grey-light: #9CA3AF;
  --green: #1E9E6A;
  --red: #C0392B;
  --shadow: 0 1px 2px rgba(26, 31, 46, 0.05), 0 2px 8px rgba(26, 31, 46, 0.05);
  --shadow-lg: 0 10px 36px rgba(26, 31, 46, 0.14);
  --radius: 12px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Content protection: block text selection of page content. */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Users must still be able to select/edit text inside form fields. */
input, textarea, select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Stop images (logo etc.) being dragged out. */
img { -webkit-user-drag: none; user-drag: none; }

/* ---------- Typeable site/client autocomplete ---------- */
.combo { position: relative; width: 100%; }
.combo-menu {
  position: absolute;
  z-index: 60;
  left: 0; right: 0; top: 100%;
  margin-top: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  display: none;
}
.combo-menu.open { display: block; }
.combo-item {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--cream);
}
.combo-item:last-child { border-bottom: none; }
.combo-item:hover,
.combo-item.active { background: var(--blue-light); color: var(--blue-dark); }

/* ---------- Returned-items blocks (Termination form) ---------- */
.item-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--cream);
}
.item-block .item-name {
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 8px;
}

/* ---------- Guidance notices (Leave Application) ---------- */
.notice {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.notice strong { color: var(--blue-dark); }
.notice p { margin: 0 0 8px; }
.notice ul { margin: 6px 0 0 18px; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }

/* ---------- Induction: Staff vs Subcontractor ---------- */
/* Email/Phone contact row hidden by default (Staff mode). */
.emp-row .emp-contact { display: none; }
/* Subcontractor: hide Position + Employee Number, show Email/Phone. */
form.sub-mode #positionField { display: none; }
form.sub-mode .emp-row .emp-number { display: none; }
form.sub-mode .emp-row .emp-contact { display: flex; }

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.nav-brand img { height: 56px; width: auto; display: block; }
.nav-brand-text { font-weight: 700; font-size: 15px; line-height: 1.2; }
.nav-brand-text span { display: block; font-weight: 400; font-size: 12px; color: var(--grey); }
.nav-back {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  transition: all .15s ease;
}
.nav-back:hover { background: var(--blue-light); border-color: var(--blue); }

/* ---------- HERO (portal) ---------- */
.hero {
  background:
    radial-gradient(ellipse 640px 280px at 18% -40%, rgba(255,255,255,.14), transparent),
    radial-gradient(ellipse 520px 240px at 88% 130%, rgba(74,144,194,.28), transparent),
    linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  padding: 56px 32px 64px;
  text-align: center;
}
.hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.5px; }
.hero p { font-size: 16px; opacity: 0.92; max-width: 620px; margin: 0 auto; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; }
.form-wrap { max-width: 820px; margin: 0 auto; padding: 32px 24px 80px; }

/* ---------- ADMIN / MAINTAINER NOTE (portal) ---------- */
.admin-note {
  max-width: 1100px;
  margin: -28px auto 8px;
  background: var(--white);
  border: 1px dashed var(--teal);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow);
}
.admin-note .tag {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--teal-dark);
  background: var(--teal-light);
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 1px;
}
.admin-note code { background: var(--blue-light); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.admin-note a { color: var(--blue); font-weight: 600; }

/* ---------- CARD GRID (portal) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: -36px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--teal); }
.card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--blue-light);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  transition: transform .2s var(--ease-out), background .2s ease;
}
.card-icon svg {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.card:hover .card-icon { transform: scale(1.08); background: var(--teal-light); color: var(--teal-dark); }
.card h3 { font-size: 17px; font-weight: 700; }
.card p { font-size: 14px; color: var(--text-soft); flex: 1; }
.card .doc { font-size: 12px; color: var(--grey-light); font-weight: 500; }
.card .go { font-size: 14px; font-weight: 600; color: var(--blue); transition: transform .2s var(--ease-out); }
.card:hover .go { transform: translateX(3px); color: var(--blue-dark); }

.section-label {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grey);
  margin: 14px 0 -6px;
  display: flex; align-items: center; gap: 14px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- FORM PAGES ---------- */
.form-head { text-align: center; margin-bottom: 28px; }
.form-head h1 { font-size: 28px; font-weight: 800; color: var(--blue); letter-spacing: -0.4px; }
.form-head .doc { font-size: 13px; color: var(--grey); margin-top: 4px; }
.form-head .intro { font-size: 15px; color: var(--text-soft); margin-top: 12px; max-width: 600px; margin-left: auto; margin-right: auto; }

form { display: block; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
legend {
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
  background: var(--blue);
  padding: 6px 16px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}
fieldset .hint {
  font-size: 13px;
  color: var(--grey);
  font-style: italic;
  margin: -4px 0 16px;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label .req { color: var(--red); margin-left: 2px; }
.sub { font-weight: 400; font-size: 12px; color: var(--grey); }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}
textarea { resize: vertical; min-height: 90px; }
input[readonly] { background: var(--cream); color: var(--text-soft); cursor: default; }

/* checkbox & radio groups */
.opts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 4px; }
.opts.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.opt {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 400; cursor: pointer;
}
.opt input { width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer; }
.opt label { margin: 0; font-weight: 400; cursor: pointer; }

/* tables (schedules / checklists) */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid-tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
table.grid-tbl th, table.grid-tbl td { border: 1px solid var(--border); padding: 7px 8px; text-align: left; vertical-align: middle; }
table.grid-tbl th { background: var(--blue-light); font-weight: 700; color: var(--blue-dark); text-align: center; }
table.grid-tbl td.rowhead { background: var(--cream); font-weight: 600; white-space: nowrap; }
table.grid-tbl input { padding: 6px 7px; font-size: 13px; }
table.grid-tbl input[type=time] { min-width: 96px; }
.checklist-tbl td.topic { width: 100%; }
.checklist-tbl th.yn, .checklist-tbl td.yn { text-align: center; width: 52px; }
.checklist-tbl tr.group td { background: var(--teal-light); font-weight: 700; color: var(--teal-dark); }

/* signature note */
.sig-note {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.note {
  background: #FFF8E6;
  border-left: 4px solid #E0A800;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #6b5500;
  margin: 4px 0 16px;
}

/* submit */
.actions { text-align: center; margin-top: 8px; }
button[type=submit] {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 44px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
button[type=submit]:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* repeatable employee rows */
.emp-row {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 14px 2px;
  margin-bottom: 12px;
  background: var(--cream);
}
.emp-row .row { margin-bottom: 0; }
.btn-remove {
  position: absolute;
  top: 8px; right: 10px;
  background: none;
  border: none;
  color: var(--red);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.btn-remove:hover { text-decoration: underline; }
.btn-add {
  background: var(--blue-light);
  color: var(--blue-dark);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-add:hover { background: var(--teal-light); border-color: var(--teal); }

/* signature pads */
.sigpad canvas {
  width: 100%; height: 160px; display: block;
  border: 1px dashed var(--teal); border-radius: 9px;
  background: #fff; touch-action: none; cursor: crosshair;
}
.sigpad-actions { margin-top: 8px; }
.sig-clear {
  background: var(--blue-light); color: var(--blue-dark);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-weight: 600; font-size: 13px;
  padding: 6px 14px; cursor: pointer;
}
.sig-clear:hover { background: var(--teal-light); border-color: var(--teal); }

/* honeypot */
.hp { position: absolute; left: -5000px; }

/* footer */
.foot { text-align: center; padding: 28px 16px; font-size: 12px; color: var(--grey-light); }
.foot a { color: var(--grey); }

/* thank you */
.ty-wrap { max-width: 560px; margin: 0 auto; padding: 80px 24px; text-align: center; }
.ty-check {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; margin: 0 auto 22px;
}
.ty-wrap h1 { font-size: 28px; color: var(--blue); margin-bottom: 12px; }
.ty-wrap p { color: var(--text-soft); margin-bottom: 26px; }
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff; text-decoration: none; font-weight: 600;
  padding: 12px 30px; border-radius: 10px;
}

@media (max-width: 640px) {
  .row, .row-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .nav { padding: 10px 16px; }
  fieldset { padding: 18px; }
}

/* ---------- ACCESSIBILITY & MOTION ---------- */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
button[type=submit]:active { transform: translateY(0) scale(.98); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Fields that don't apply to the selected leave type (e.g. dates on a cash-out) */
.field.na { opacity: .45; }
.field.na .req { display: none; }
.field.na input { background: #eee; pointer-events: none; }
