/* ════════════════════════════════════════════════════════════════
   CDS LOGISTICS — Auth / Login CSS v4
   Standalone — no imports needed, self-contained
   ════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

/* FIX: html must allow scroll on mobile — no overflow:hidden here */
html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #050810;
  /* FIX: min-height instead of height, and NO overflow:hidden — lets page scroll on mobile */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Base padding + iOS safe area so login card isn't behind status bar / home indicator */
  padding: calc(20px + var(--safe-top, 0px)) 20px calc(40px + var(--safe-bottom, 0px));
  -webkit-font-smoothing: antialiased;
  position: relative;
  /* FIX: was overflow:hidden — that is what blocked scrolling on mobile */
  overflow-x: hidden;
}

/* ── BACKGROUND GLOWS ── */
.auth-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.auth-bg-glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .12;
}
.auth-bg-glow-1 {
  width: 500px; height: 500px;
  background: #2352ff;
  top: -150px; left: -100px;
}
.auth-bg-glow-2 {
  width: 400px; height: 400px;
  background: #6c3fff;
  bottom: -100px; right: -80px;
}
.auth-bg-glow-3 {
  width: 300px; height: 300px;
  background: #22c55e;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: .04;
}
.auth-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(35,82,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35,82,255,.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── SCENE WRAPPER ── */
.auth-scene {
  position: relative; z-index: 1;
  width: 100%; max-width: 1000px;
  display: flex; flex-direction: column; align-items: center;
}

/* ── BRAND HEADER ── */
.auth-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px; text-align: center;
}
.auth-brand-mark {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, #2352ff, #6c3fff);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  letter-spacing: .5px;
  border: 0.5px solid rgba(255,255,255,.12);
  flex-shrink: 0;
}
.auth-brand-text .name {
  font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2;
}
.auth-brand-text .sub {
  font-size: 10px; color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: .8px; margin-top: 2px;
}

/* ── PORTAL GRID ── */
.auth-portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}
@media (max-width: 700px) {
  .auth-portal-grid { grid-template-columns: 1fr; max-width: 380px; }
}

/* ── PORTAL CARD ── */
.auth-card {
  background: rgba(255,255,255,.04);
  border: 0.5px solid rgba(255,255,255,.09);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  cursor: pointer;
}
.auth-card:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.065);
  border-color: rgba(255,255,255,.15);
}

/* Coloured top accent bar */
.auth-card-accent { height: 3px; }

.auth-card-body { padding: 22px 20px 18px; }

/* Icon + label row */
.auth-card-icon-row {
  display: flex; align-items: center; gap: 11px; margin-bottom: 16px;
}
.auth-card-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
}
.auth-card-name {
  font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2;
}
.auth-card-sub {
  font-size: 10px; color: rgba(255,255,255,.3); margin-top: 2px; letter-spacing: .2px;
}

/* Role badge */
.auth-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 9999px;
  font-size: 9px; font-weight: 700; letter-spacing: .3px;
  margin-bottom: 13px;
}

/* Heading */
.auth-card-title {
  font-size: 20px; font-weight: 800; color: #fff;
  letter-spacing: -.4px; margin-bottom: 3px;
}
.auth-card-desc {
  font-size: 11px; color: rgba(255,255,255,.35);
  line-height: 1.55; margin-bottom: 18px;
}

/* Flash */
.auth-flash {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 13px; border-radius: 9px;
  font-size: 11px; font-weight: 600; margin-bottom: 14px;
}
.auth-flash-error {
  background: rgba(255,59,92,.1);
  border: 0.5px solid rgba(255,59,92,.25);
  color: #ff6b84;
}
.auth-flash-success {
  background: rgba(34,197,94,.1);
  border: 0.5px solid rgba(34,197,94,.25);
  color: #4ade80;
}

/* Form fields */
.auth-field { margin-bottom: 11px; }
.auth-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: rgba(255,255,255,.3);
  display: block; margin-bottom: 6px;
}
.auth-input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 0.5px solid rgba(255,255,255,.1);
  border-radius: 9px; padding: 11px 13px;
  font-size: 13px; color: #fff;
  font-family: 'Inter', sans-serif;
  transition: border-color .15s, background .15s;
  /* FIX: prevent iOS zoom on focus (font-size must be >= 16px or use this) */
  font-size: max(13px, 16px);
}
.auth-input:focus {
  outline: none;
  border-color: rgba(35,82,255,.55);
  background: rgba(35,82,255,.06);
}
.auth-input::placeholder { color: rgba(255,255,255,.18); }

/* Submit button */
.auth-btn {
  width: 100%; padding: 12px;
  border: none; border-radius: 10px;
  font-size: 12px; font-weight: 700;
  color: #fff; font-family: 'Inter', sans-serif;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 7px;
  letter-spacing: .2px;
  transition: opacity .15s, transform .1s;
  margin-top: 4px;
}
.auth-btn:hover { opacity: .9; }
.auth-btn:active { transform: scale(.99); opacity: .85; }

/* Card footer */
.auth-card-footer {
  padding: 11px 20px;
  border-top: 0.5px solid rgba(255,255,255,.06);
  text-align: center;
  font-size: 10px; color: rgba(255,255,255,.22);
}
.auth-card-footer a {
  color: rgba(35,82,255,.8);
  font-weight: 700; text-decoration: none;
  transition: color .12s;
}
.auth-card-footer a:hover { color: #7faeff; }

/* ── BOTTOM FOOTER ── */
.auth-footer {
  text-align: center;
  font-size: 10px; color: rgba(255,255,255,.15);
  margin-top: 20px;
  line-height: 1.6;
}
.auth-footer a { color: rgba(255,255,255,.25); }

/* ── ACTIVE CARD HIGHLIGHT ── */
.auth-card.selected {
  transform: translateY(-3px);
  background: rgba(255,255,255,.07);
}

/* ── SINGLE CARD MODE (focused login) ── */
.auth-single {
  width: 100%; max-width: 420px;
}
.auth-single .auth-card { cursor: default; }
.auth-single .auth-card:hover { transform: none; }

/* ── PORTAL SELECTOR TABS ── */
.auth-tabs {
  display: flex; gap: 0;
  background: rgba(255,255,255,.04);
  border: 0.5px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: 3px;
  margin-bottom: 20px; width: 100%;
}
.auth-tab {
  flex: 1; padding: 8px 10px;
  border-radius: 8px; border: none;
  background: transparent; font-size: 11px; font-weight: 600;
  cursor: pointer; color: rgba(255,255,255,.35);
  font-family: 'Inter', sans-serif;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.auth-tab.active {
  background: rgba(255,255,255,.1);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  body { padding: 16px; padding-bottom: 40px; align-items: flex-start; }
  .auth-brand { margin-top: 8px; margin-bottom: 20px; }
  .auth-card-body { padding: 18px 16px 14px; }
  .auth-card-title { font-size: 18px; }
  .auth-portal-grid { gap: 10px; }
}
