/* ============================================================
   HERBERT MOTOS — Auth modal + Minha Conta
   Depends on styles.css tokens. Loaded on every page.
   ============================================================ */

/* ---------------- Auth modal ---------------- */
.auth-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 4, 6, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-scrim.open { opacity: 1; visibility: visible; }

.auth-modal {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(170deg, rgba(26, 26, 30, 0.96), rgba(12, 12, 14, 0.98));
  border: 1px solid var(--glass-line);
  border-top: 3px solid var(--ktm-orange);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  padding: 26px 24px 28px;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.4s ease;
  max-height: 92vh;
  overflow-y: auto;
}
.auth-scrim.open .auth-modal { transform: none; opacity: 1; }

.auth-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.auth-modal__head .logo { height: 34px; }
.auth-modal__close {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}
.auth-modal__close:hover { background: var(--surface-2); color: var(--text); }
.auth-modal__close svg { width: 22px; height: 22px; }

.auth-modal__title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 28px;
  line-height: 1;
  margin: 14px 0 4px;
}
.auth-modal__sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tabs button {
  padding: 11px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 15px;
  color: var(--muted);
  transition: background 0.25s var(--ease-out), color 0.25s ease;
}
.auth-tabs button.active { background: var(--ktm-orange); color: #0a0a0a; }

.auth-pane { display: none; }
.auth-pane.active { display: block; animation: itemIn 0.35s var(--ease-out); }

.auth-modal .field { margin-bottom: 13px; }
.auth-modal .field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
}
.auth-modal .field input {
  width: 100%;
  background: var(--ink-2);
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-modal .field input::placeholder { color: var(--muted-2); }
.auth-modal .field input:focus {
  outline: none;
  border-color: var(--ktm-orange);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}

.auth-forgot {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 14px;
  transition: color 0.2s ease;
}
.auth-forgot:hover { color: var(--ktm-orange); }

.auth-modal .btn { width: 100%; height: 50px; }

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 18px 0;
}
.auth-or::before, .auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-social { display: grid; gap: 10px; }
.auth-social button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.auth-social button:hover { border-color: var(--ktm-orange); }
.auth-social button svg { width: 20px; height: 20px; }

.auth-foot { text-align: center; font-size: 12px; color: var(--muted-2); margin-top: 18px; line-height: 1.6; }
.auth-foot a { color: var(--muted); }
.auth-foot a:hover { color: var(--ktm-orange); }

/* ============================================================
   MINHA CONTA
   ============================================================ */
.account-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
}
.account-avatar {
  width: 64px; height: 64px;
  border-radius: 16px;
  flex: none;
  background: linear-gradient(135deg, var(--ktm-orange-lt), var(--ktm-orange-deep));
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: #0a0a0a;
  box-shadow: 0 10px 26px -10px var(--ktm-glow);
}
.account-hero__info { flex: 1; min-width: 0; }
.account-hero__hi {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(24px, 7vw, 38px);
  line-height: 1.08;
}
.account-hero__email { color: var(--muted); font-size: 14px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-logout {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 9px 13px; border-radius: 10px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.account-logout:hover { border-color: #ff6b6b; color: #ff6b6b; }
.account-logout svg { width: 16px; height: 16px; }

/* tab nav */
.acct-nav {
  display: flex;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.acct-nav button {
  flex: 1;
  white-space: nowrap;
  padding: 12px 14px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 15px;
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.25s var(--ease-out), color 0.25s ease;
}
.acct-nav button svg { width: 17px; height: 17px; }
.acct-nav button.active { background: var(--ktm-orange); color: #0a0a0a; }

.acct-pane { display: none; }
.acct-pane.active { display: block; animation: itemIn 0.35s var(--ease-out); }

/* order card + tracking */
.order-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.order-block__head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.order-block__id { font-family: "Courier New", monospace; font-size: 12px; color: var(--muted); }
.order-block__id b { display: block; color: var(--ktm-orange); font-size: 18px; letter-spacing: 0.03em; }
.order-block__date { font-size: 12px; color: var(--muted-2); }
.order-status-pill {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.06em;
  padding: 6px 12px; border-radius: 20px;
  background: rgba(255,102,0,0.14); color: var(--ktm-orange);
}
.order-status-pill.done { background: rgba(43,217,107,0.14); color: #2bd96b; }

.order-block__body { padding: 18px; }

/* tracking timeline */
.track {
  display: grid;
  gap: 0;
  margin-bottom: 8px;
}
.track-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  position: relative;
}
.track-step__dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--muted-2);
  position: relative;
  z-index: 1;
  flex: none;
}
.track-step__dot svg { width: 16px; height: 16px; }
.track-step:not(:last-child) .track-step__dot::after {
  content: "";
  position: absolute;
  top: 32px; left: 50%;
  transform: translateX(-50%);
  width: 2px; height: calc(100% + 14px);
  background: var(--line);
}
.track-step__body { padding-bottom: 20px; }
.track-step__t {
  font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; font-size: 16px; line-height: 1;
}
.track-step__d { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* completed */
.track-step.done .track-step__dot { background: #2bd96b; color: #04240f; }
.track-step.done .track-step__dot::after { background: #2bd96b; }
/* current */
.track-step.current .track-step__dot {
  background: var(--ktm-orange); color: #0a0a0a;
  box-shadow: 0 0 0 0 var(--ktm-glow);
  animation: pulseDot 2s var(--ease-out) infinite;
}
.track-step.current .track-step__t { color: var(--ktm-orange); }
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(255,102,0,0.5); }
  70% { box-shadow: 0 0 0 10px rgba(255,102,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,102,0,0); }
}
.track-step.pending .track-step__t { color: var(--muted-2); }

.order-block__items {
  border-top: 1px dashed var(--line);
  margin-top: 6px; padding-top: 14px;
  display: grid; gap: 10px;
}
.order-block__items .oi { display: flex; align-items: center; gap: 12px; }
.order-block__items .oi .th { width: 42px; height: 42px; border-radius: 8px; overflow: hidden; flex: none; }
.order-block__items .oi .nm { flex: 1; font-size: 14px; }
.order-block__items .oi .nm small { display: block; color: var(--muted); font-size: 12px; }
.order-block__items .oi .pr { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }

.order-block__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.order-block__total { font-size: 13px; color: var(--muted); }
.order-block__total b { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--text); display: block; }
.track-code {
  font-size: 12px; color: var(--muted);
}
.track-code b { color: var(--text); font-family: "Courier New", monospace; }

/* dados / endereços cards */
.acct-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.acct-card h3 {
  font-family: var(--font-display); font-weight: 800;
  text-transform: uppercase; font-size: 20px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.addr-tag {
  display: inline-block;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.06em;
  background: rgba(255,102,0,0.14); color: var(--ktm-orange);
  padding: 4px 10px; border-radius: 6px; margin-bottom: 10px;
}
.addr-text { color: var(--text); font-size: 15px; line-height: 1.6; }
.addr-text span { color: var(--muted); }

.acct-empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.acct-empty svg { width: 54px; height: 54px; opacity: 0.4; margin-bottom: 12px; }
.acct-empty .btn { margin-top: 16px; }

@media (min-width: 800px) {
  .acct-nav { max-width: 520px; }
  .account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
}
