/* ============================================================
   AUTH.CSS — Orbit Logistics / TOS Phase 2
   Premium, smooth, professional.
   Reuses existing CSS variable tokens only — no new colors.
   ============================================================ */

/* ─── NAV: Sign In button ─────────────────────────────────── */
#authNav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .18s ease, box-shadow .18s ease;
  flex-shrink: 0;
}
.signin-btn svg {
  flex: none;
  width: 14px;
  height: 14px;
  opacity: .85;
  transition: opacity .2s;
}
.signin-btn:hover {
  border-color: var(--amber);
  background: rgba(245,147,10,.09);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -4px rgba(245,147,10,.25);
}
.signin-btn:hover svg { opacity: 1; }
.signin-btn:active { transform: translateY(0); }

/* ─── NAV: My Account (post-login) ───────────────────────── */
.acct-wrap { position: relative; }

.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 5px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .18s;
  flex-shrink: 0;
}
.acct-btn:hover {
  border-color: var(--amber);
  background: rgba(245,147,10,.07);
  transform: translateY(-1px);
}
.acct-btn:active { transform: translateY(0); }

.acct-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(135deg, var(--amber-d), var(--amber));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av-txt { font-size: 10px; font-weight: 800; color: #0a0b0e; line-height: 1; }

.acct-name {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-caret {
  flex: none;
  opacity: .55;
  transition: transform .2s, opacity .2s;
}
.acct-btn:hover .acct-caret { opacity: .9; }
.acct-menu.open ~ * .acct-caret,
.acct-wrap:has(.acct-menu.open) .acct-caret { transform: rotate(180deg); opacity: .9; }

/* Dropdown */
.acct-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: var(--d3);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  box-shadow: 0 24px 60px -14px rgba(0,0,0,.7);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.97);
  transition: opacity .16s cubic-bezier(.22,1,.36,1), transform .2s cubic-bezier(.22,1,.36,1), visibility .2s;
  z-index: 600;
}
.acct-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.acct-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 9px 12px;
}
.acct-avatar.lg { width: 38px; height: 38px; }
.acct-avatar.lg .av-txt { font-size: 13px; }
.acct-menu-id { overflow: hidden; }
.acct-menu-id strong { display: block; font-size: 13.5px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu-id span { display: block; font-size: 11.5px; color: var(--muted2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.acct-menu-pct {
  display: block;
  padding: 9px 11px;
  margin: 0 0 4px;
  border-radius: 8px;
  background: rgba(245,147,10,.06);
  transition: background .15s;
}
.acct-menu-pct:hover { background: rgba(245,147,10,.11); }
.acct-menu-pct span:first-child { display: block; font-size: 11.5px; font-weight: 600; color: var(--amber-h); margin-bottom: 6px; }
.acct-menu-bar { display: block; height: 4px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.acct-menu-bar span { display: block; height: 100%; background: var(--amber); border-radius: 3px; transition: width .4s var(--ease); }
.acct-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s, padding-left .15s;
  opacity: 0;
  transform: translateY(-4px);
}
.acct-menu.open a {
  opacity: 1;
  transform: translateY(0);
  transition: background .15s, color .15s, padding-left .15s, opacity .22s ease, transform .22s ease;
}
.acct-menu.open a:nth-of-type(1) { transition-delay: .02s; }
.acct-menu.open a:nth-of-type(2) { transition-delay: .05s; }
.acct-menu.open a:nth-of-type(3) { transition-delay: .08s; }
.acct-menu.open a:nth-of-type(4) { transition-delay: .11s; }
.acct-menu a:hover { background: rgba(245,147,10,.09); color: #fff; padding-left: 14px; }
.acct-menu a svg   { flex: none; width: 15px; height: 15px; }
.acct-menu-owner   { color: var(--amber-h) !important; font-weight: 700 !important; }
.acct-menu hr      { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 6px 5px; }
.acct-menu .lo     { color: #ff7070; }
.acct-menu .lo:hover { background: rgba(255,80,80,.08); color: #ff8a8a; }

/* ─── MODAL OVERLAY ──────────────────────────────────────── */
.au-overlay {
  position: fixed;
  inset: 0;
  /* PERF: backdrop-filter:blur on a full-screen overlay repaints the whole
     viewport every frame while the overlay fades in, which is the main cause of
     the login screen feeling laggy on desktop. A slightly stronger solid scrim
     is visually close and costs nothing to composite. */
  background: rgba(5,6,9,.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}
.au-overlay.open {
  opacity: 1;
  visibility: visible;
}

.au-modal {
  background: var(--d3);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 32px 30px 28px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Entry animation */
  transform: translateY(18px) scale(.97);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.au-overlay.open .au-modal {
  transform: translateY(0) scale(1);
}

/* Scrollbar style */
.au-modal::-webkit-scrollbar { width: 4px; }
.au-modal::-webkit-scrollbar-track { background: transparent; }
.au-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.au-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.au-close:hover { background: rgba(255,255,255,.09); color: #fff; transform: rotate(90deg); }

/* ─── MODAL CONTENT ─────────────────────────────────────── */
.au-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.au-h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 6px;
  line-height: 1.2;
}
.au-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.au-perks {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.au-perks li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.au-perks svg {
  flex: none;
  width: 14px; height: 14px;
  margin-top: 1px;
  color: var(--green);
}

/* ─── GOOGLE BUTTON ─────────────────────────────────────── */
.au-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  color: #1a1a1a;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.au-google:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -6px rgba(0,0,0,.35);
}
.au-google:active { transform: translateY(0); }

/* ─── DIVIDER ───────────────────────────────────────────── */
.au-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted2);
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.au-divider::before,
.au-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.08);
}

/* ─── FORM ──────────────────────────────────────────────── */
.au-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.au-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.au-field label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 1.4px;
  color: var(--muted);
  text-transform: uppercase;
}
.au-field input,
.au-form input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  padding: 11px 13px;
  color: #fff;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.au-field input:focus,
.au-form input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245,147,10,.12);
  background: rgba(245,147,10,.03);
  outline: none;
}
.au-field input::placeholder,
.au-form input::placeholder { color: var(--muted2); }

/* Submit */
.au-submit {
  width: 100%;
  background: var(--amber);
  color: #0a0b0e;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
  transition: background .2s, transform .18s, box-shadow .18s, opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
}
.au-submit:hover:not(:disabled) {
  background: var(--amber-h);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(245,147,10,.4);
}
.au-submit:active:not(:disabled) { transform: translateY(0); }
.au-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.au-submit.success {
  background: var(--green) !important;
  color: #0a0b0e;
}
.au-submit.success:hover { transform: none; box-shadow: none; }

/* Spinner inside button */
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(10,11,14,.3);
  border-top-color: #0a0b0e;
  border-radius: 50%;
  animation: tospin .7s linear infinite;
  flex: none;
}
@keyframes tospin { to { transform: rotate(360deg); } }

/* ─── MESSAGES ──────────────────────────────────────────── */
.au-msg {
  margin-top: 10px;
  font-size: 12.5px;
  font-family: 'IBM Plex Mono', monospace;
  padding: 9px 12px;
  border-radius: 7px;
  display: none;
  line-height: 1.5;
}
.au-msg.ok {
  display: block;
  background: rgba(61,214,140,.07);
  border: 1px solid rgba(61,214,140,.22);
  color: var(--green);
}
.au-msg.er {
  display: block;
  background: rgba(255,80,80,.07);
  border: 1px solid rgba(255,80,80,.18);
  color: #ff7070;
}

/* ─── SWITCH / LINKS ────────────────────────────────────── */
.au-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}
.au-switch a,
.au-link {
  color: var(--amber);
  font-weight: 600;
  cursor: pointer;
  transition: color .15s;
}
.au-switch a:hover,
.au-link:hover { color: var(--amber-h); }

/* ─── ONBOARDING ─────────────────────────────────────────── */
.ob-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ob-prefill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(245,147,10,.06);
  border: 1px solid rgba(245,147,10,.16);
  margin-bottom: 16px;
}
.ob-prefill img {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex: none;
}
.ob-prefill div { font-size: 13px; }
.ob-prefill strong { display: block; color: #fff; font-size: 13.5px; font-weight: 700; }
.ob-prefill span  { color: var(--muted); font-size: 12px; }
.ob-acct-email { text-align: center; font-size: 11.5px; color: var(--muted2); margin-top: 16px; font-family: 'IBM Plex Mono', monospace; }

/* Step dots */
.ob-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.ob-dot { width: 22px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.12); transition: background .25s, width .25s; }
.ob-dot.on { background: var(--amber); width: 30px; }
.ob-dot.done { background: rgba(245,147,10,.55); }

/* Welcome screen */
.ob-welcome { text-align: center; }
.ob-welcome .au-eyebrow,
.ob-welcome .au-h2,
.ob-welcome .au-sub { text-align: center; }
.ob-welcome .au-perks { align-items: center; }
.ob-welcome .au-perks li { justify-content: center; }
.ob-badge {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--amber-d), var(--amber));
  color: #0a0b0e;
  overflow: hidden;
  box-shadow: 0 10px 30px -8px rgba(245,147,10,.5);
  animation: obPop .5s var(--ease);
}
.ob-badge svg { width: 28px; height: 28px; }
.ob-badge img { width: 100%; height: 100%; object-fit: cover; }
@keyframes obPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Completing / checklist animation */
.ob-completing .au-eyebrow,
.ob-completing .au-h2,
.ob-completing .au-sub { text-align: center; }
.ob-checklist { margin-top: 22px; display: flex; flex-direction: column; gap: 4px; }
.ob-check-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 6px;
  font-size: 13.5px; font-weight: 600;
  color: var(--muted2);
  opacity: .45;
  transition: opacity .3s, color .3s;
}
.ob-check-row .ob-check-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted2); border: 1.5px solid rgba(255,255,255,.14); transition: background .25s, border-color .25s, color .25s, transform .25s; }
.ob-check-row .ob-check-ico svg { width: 12px; height: 12px; }
.ob-check-row.hit { opacity: 1; color: #fff; }
.ob-check-row.hit .ob-check-ico { background: var(--green); border-color: var(--green); color: #0a0b0e; transform: scale(1.08); }
.ob-check-row.skip { opacity: .65; color: var(--muted); }

/* Celebration */
.ob-celebrate { text-align: center; position: relative; overflow: hidden; padding-top: 4px; }
.ob-celebrate .au-eyebrow,
.ob-celebrate .au-h2,
.ob-celebrate .au-sub { text-align: center; }
.ob-success-badge {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green);
  color: #0a0b0e;
  position: relative;
  animation: obPop .5s var(--ease);
}
.ob-success-badge svg { width: 30px; height: 30px; }
.ob-success-badge::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(61,214,140,.4);
  animation: obRing 1.4s var(--ease) infinite;
}
@keyframes obRing { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.ob-pct-pill {
  display: inline-block;
  margin: 4px auto 20px;
  padding: 7px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(245,147,10,.08);
  border: 1px solid rgba(245,147,10,.22);
  color: var(--amber-h);
}

/* Confetti */
.ob-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 7px; height: 11px;
  border-radius: 1px;
  opacity: .9;
  animation: confettiFall 1.6s ease-in forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: .95; }
  100% { transform: translateY(220px) rotate(280deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ob-badge, .ob-success-badge, .ob-success-badge::after, .confetti-piece, .ob-check-row { animation: none !important; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .au-modal { padding: 24px 20px 22px; border-radius: 14px 14px 0 0; align-self: flex-end; max-height: 88vh; }
  .au-overlay { align-items: flex-end; padding: 0; }
  .au-overlay.open .au-modal { transform: translateY(0) scale(1); }
  .au-overlay .au-modal { transform: translateY(100%) scale(1); }
  .ob-row { grid-template-columns: 1fr; }
  .acct-name { display: none; }
}

@media (max-width: 480px) {
  .signin-btn { padding: 8px 11px; font-size: 12.5px; gap: 5px; }
}
