/* ============================================================
   SG MANPOWER SOLUTIONS · Custom Stylesheet
   ============================================================ */

/* ── Variables ── */
:root {
  --primary:   #1a56db;
  --secondary: #f59e0b;
  --success:   #10b981;
  --navy:      #0d1f42;
  --navy-soft: #132d5e;
  --card-radius: 18px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  scroll-behavior: smooth;
}

/* ── ion-icon global: always vertically centered inline ── */
ion-icon {
  vertical-align: middle;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Navbar ── */
.bg-navy   { background-color: var(--navy) !important; }
.text-navy { color: var(--navy) !important; }

.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #1a56db, #60a5fa);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
}

/* ── Header Banner ── */
.site-header {
  position: relative;
  width: 100%;
  line-height: 0; /* remove gap under inline image */
}

/* Image is in NORMAL FLOW — full image always visible, no cropping */
.header-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Overlay floats over bottom of image only */
.header-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(
    to bottom,
    transparent     0%,
    rgba(0,0,0,.55) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 48px 12px 16px;
}

.header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .83rem; font-weight: 600;
  white-space: nowrap;
}

/* ── Main Background ── */
.main-bg { background: #f0f4f8; }

/* ──────────────────────────────────────
   STEP PROGRESS INDICATOR
   ────────────────────────────────────── */
.step-progress {
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.step-item {
  display: flex; flex-direction: column; align-items: center;
  user-select: none;
}

.step-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #94a3b8;
  border: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
  z-index: 1;
}

.step-item.active .step-circle {
  background: var(--primary);
  color: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 5px rgba(26,86,219,.18);
}

.step-item.completed .step-circle {
  background: var(--success);
  color: #fff;
  border-color: #6ee7b7;
}

.step-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  transition: color var(--transition);
}
.step-item.active    .step-label { color: var(--primary); }
.step-item.completed .step-label { color: var(--success); }

.step-line {
  flex: 1;
  height: 3px;
  background: #e2e8f0;
  margin: 0 4px;
  margin-bottom: 22px;
  border-radius: 2px;
  transition: background var(--transition);
  min-width: 16px;
}
.step-line.completed { background: var(--success); }

/* ──────────────────────────────────────
   FORM CARD
   ────────────────────────────────────── */
.card-form {
  border-radius: var(--card-radius) !important;
  background: #ffffff;
}

/* Step header layout */
.step-header {
  display: flex; align-items: flex-start; gap: 16px;
}

.step-num-badge {
  font-size: 2.8rem; font-weight: 900; line-height: 1;
  color: #e2e8f0; min-width: 64px;
  display: block;
}

/* Alert inside form */
.form-alert { border-radius: 10px; margin-bottom: 16px; }

/* ──────────────────────────────────────
   STEP 2 · OTP
   ────────────────────────────────────── */
.otp-info-box { border: 1px solid rgba(26,86,219,.15); }

.otp-input {
  width: 52px !important;
  height: 56px;
  font-size: 1.5rem; font-weight: 700;
  text-align: center;
  border-radius: 12px !important;
  border: 2px solid #e2e8f0;
  transition: border-color .2s, box-shadow .2s;
  caret-color: var(--primary);
}
.otp-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26,86,219,.15);
  outline: none;
}

/* ──────────────────────────────────────
   STEP 4 · Photo Upload
   ────────────────────────────────────── */
.photo-upload-wrap { display: inline-block; }

.photo-box {
  width: 140px; height: 140px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color .2s, background .2s;
  overflow: hidden;
  margin: 0 auto;
}
.photo-box:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.photo-preview-img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ──────────────────────────────────────
   STEP 5 · Loading / Processing
   ────────────────────────────────────── */

/* Ring spinner */
.ring-spinner {
  display: inline-block;
  position: relative;
  width: 110px; height: 110px;
}
.ring-spinner div {
  box-sizing: border-box;
  display: block; position: absolute;
  width: 88px; height: 88px;
  margin: 11px;
  border: 9px solid var(--primary);
  border-radius: 50%;
  animation: ring-spin 1.2s cubic-bezier(.5,0,.5,1) infinite;
  border-color: var(--primary) transparent transparent transparent;
}
.ring-spinner div:nth-child(1) { animation-delay: -.45s; }
.ring-spinner div:nth-child(2) { animation-delay: -.3s; }
.ring-spinner div:nth-child(3) { animation-delay: -.15s; }

@keyframes ring-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Countdown box */
.countdown-box {
  background: linear-gradient(135deg, var(--navy), #1a56db);
  color: #fff;
  border-radius: 20px;
  padding: 20px 44px;
  max-width: 280px;
  box-shadow: 0 8px 30px rgba(26,86,219,.35);
}
.countdown-label {
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; opacity: .7; text-align: center;
}
.time-digit {
  font-size: 3rem; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.time-unit-label {
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .1em; opacity: .75;
  text-align: center; margin-top: 4px;
}
.time-colon {
  font-size: 3rem; font-weight: 900;
  padding-bottom: 18px; opacity: .8;
}

/* Processing list */
.proc-list {
  max-width: 360px;
}
.proc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #f8fafc;
  font-size: .88rem;
  transition: background .3s, color .3s;
}
.proc-item.state-active {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
}
.proc-item.state-done {
  background: #f0fdf4;
  color: var(--success);
}
.proc-item.state-done .proc-icon ion-icon  { color: var(--success); }
.proc-item.state-active .proc-icon ion-icon { color: var(--primary); }
.proc-icon {
  font-size: 1.2rem;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Success state spinner override */
.ring-spinner.success div {
  border-color: var(--success) transparent transparent transparent;
}

/* ──────────────────────────────────────
   STATS CARD
   ────────────────────────────────────── */
.stats-icon {
  font-size: 2rem; display: block; margin-bottom: 4px;
}

/* ──────────────────────────────────────
   FOOTER
   ────────────────────────────────────── */
footer.bg-navy { background-color: var(--navy) !important; }

.footer-social {
  transition: color .2s;
  text-decoration: none;
}
.footer-social:hover { color: var(--secondary) !important; }

/* ──────────────────────────────────────
   APPLICANT NOTIFICATION TOAST
   ────────────────────────────────────── */
.applicant-toast {
  position: fixed;
  bottom: 24px; left: 24px;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
  z-index: 9999;
  max-width: 280px;
  min-width: 240px;
  transform: translateX(calc(-100% - 32px));
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .4s;
  border-left: 4px solid var(--success);
  opacity: 0;
}
.applicant-toast.visible {
  transform: translateX(0);
  opacity: 1;
}

.applicant-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: #fff;
  flex-shrink: 0; text-transform: uppercase;
}

.toast-close {
  cursor: pointer; font-size: 1.1rem;
  flex-shrink: 0; line-height: 1;
  opacity: .5; transition: opacity .2s;
}
.toast-close:hover { opacity: 1; }

/* ──────────────────────────────────────
   UTILITIES
   ────────────────────────────────────── */
.rounded-4 { border-radius: 16px !important; }

/* Form controls custom */
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}
.btn-primary {
  background: var(--primary); border-color: var(--primary);
}
.btn-primary:hover {
  background: #1648c7; border-color: #1648c7;
}
.btn-success {
  background: var(--success); border-color: var(--success);
}
.btn-success:hover { background: #0ea574; border-color: #0ea574; }

/* ──────────────────────────────────────
   SIDEBAR
   ────────────────────────────────────── */
.sidebar-sticky {
  position: sticky;
  top: 72px;
}

.sidebar-job-list li {
  transition: background .15s;
  border-radius: 8px;
  padding-left: 4px;
  padding-right: 4px;
}
.sidebar-job-list li:hover {
  background: #f1f5f9;
}
.sidebar-job-list ion-icon {
  font-size: 1rem;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ──────────────────────────────────────
   DESKTOP (lg: 992px+)
   ────────────────────────────────────── */
@media (min-width: 992px) {
  .step-circle    { width: 58px; height: 58px; font-size: 1.55rem; }
  .step-label     { font-size: .73rem; }
  .step-line      { margin: 0 8px; margin-bottom: 26px; min-width: 30px; }
  .otp-input      { width: 62px !important; height: 66px; font-size: 1.75rem; }
  .proc-list      { max-width: 460px; }
  .countdown-box  { padding: 24px 52px; }
  .time-digit     { font-size: 3.5rem; }
  .time-colon     { font-size: 3.5rem; }
  .ring-spinner   { width: 120px; height: 120px; }
  .ring-spinner div { width: 96px; height: 96px; margin: 12px; border-width: 10px; }
}

/* ──────────────────────────────────────
   EXTRA LARGE (xl: 1200px+)
   ────────────────────────────────────── */
@media (min-width: 1200px) {
  .step-num-badge { font-size: 3.2rem; min-width: 72px; }
  .step-circle    { width: 64px; height: 64px; font-size: 1.7rem; }
  .card-form > .card-body { padding: 3rem !important; }
}

/* ──────────────────────────────────────
   TABLET (max 768px)
   ────────────────────────────────────── */
@media (max-width: 768px) {
  .header-overlay  { padding: 36px 10px 14px; }
  .chip            { font-size: .78rem; padding: 4px 12px; }
  .main-bg         { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .proc-list       { max-width: 100%; }
}

/* ──────────────────────────────────────
   MOBILE (max 576px)
   ────────────────────────────────────── */
@media (max-width: 576px) {
  /* Banner chips */
  .header-overlay  { padding: 28px 8px 10px; }
  .chip            { font-size: .7rem; padding: 3px 10px; gap: 4px; }

  /* Main layout */
  main.py-5        { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

  /* Step indicator */
  .step-circle     { width: 36px; height: 36px; font-size: .9rem; }
  .step-label      { font-size: .58rem; letter-spacing: 0; }
  .step-line       { margin: 0 3px; margin-bottom: 20px; min-width: 10px; }
  .step-num-badge  { font-size: 1.8rem; min-width: 44px; }

  /* Form card */
  .card-form .card-body { padding: 1.25rem !important; }

  /* OTP */
  .otp-input       { width: 44px !important; height: 48px; font-size: 1.2rem; }

  /* Step 5 */
  .countdown-box   { padding: 14px 20px; max-width: 100%; width: 100%; }
  .time-digit      { font-size: 2.2rem; }
  .time-colon      { font-size: 2.2rem; }
  .proc-list       { max-width: 100%; }
  .proc-item       { font-size: .82rem; padding: 8px 10px; }

  /* Buttons */
  .btn-lg          { font-size: .92rem; padding: .55rem 1.2rem; }

  /* Toast */
  .applicant-toast { max-width: 240px; min-width: 190px; bottom: 12px; left: 12px; }
}

/* ──────────────────────────────────────
   SMALL PHONES (max 400px)
   ────────────────────────────────────── */
@media (max-width: 400px) {
  .step-line       { min-width: 6px; margin: 0 2px; margin-bottom: 20px; }
  .step-circle     { width: 30px; height: 30px; font-size: .78rem; }
  .step-label      { display: none; }
  .otp-input       { width: 38px !important; height: 42px; font-size: 1.05rem; }
  .card-form .card-body { padding: 1rem !important; }
  .applicant-toast { max-width: 200px; min-width: 170px; left: 8px; bottom: 8px; }
  .chip            { font-size: .65rem; padding: 3px 8px; }
}
