/* Account page — builds on the tokens defined in styles.css. */

.account-page { padding: 34px 0 90px; }
.loading { padding: 90px 0; text-align: center; color: var(--text-3); }

/* Shared form controls (.field, inputs, textareas) live in styles.css so the
   storefront's cart drawer gets them too. */

/* ---------------- Signed out ---------------- */

.auth { display: grid; gap: 26px; align-items: start; }
@media (min-width: 900px) { .auth { grid-template-columns: 1fr 1fr; gap: 46px; } }

.auth__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.auth__tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.auth__tab {
  flex: 1; padding: 9px; border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.auth__tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.auth__title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.auth__sub { font-size: 13.5px; color: var(--text-2); margin: 0 0 20px; line-height: 1.5; }
.auth__error {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 9px;
  background: var(--danger-soft); color: var(--danger);
  font-size: 13px; font-weight: 500;
}
.auth__foot { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--text-2); }

.auth__aside { padding: 6px 0; }
.auth__aside h2 { font-size: 16px; font-weight: 700; margin: 0 0 16px; }
.auth__aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.auth__aside li { display: flex; gap: 13px; align-items: flex-start; }
.auth__aside li > span { font-size: 20px; line-height: 1.2; }
.auth__aside b { display: block; font-size: 14px; margin-bottom: 2px; }
.auth__aside p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ---------------- Signed in ---------------- */

.acct__head {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 22px;
}
.acct__who { display: flex; gap: 14px; align-items: center; }
.acct__avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 21px; font-weight: 700; flex: none;
}
.acct__head h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 3px; }
.acct__head p { margin: 0; font-size: 13px; color: var(--text-2); }
.acct__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.acct__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 34px; }
@media (min-width: 720px) { .acct__stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px;
}
.stat__n { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat__l { display: block; margin-top: 3px; font-size: 12px; color: var(--text-3); }
.stat--good .stat__n { color: var(--brand); }

.acct__section { margin-bottom: 40px; scroll-margin-top: 90px; }
.acct__section h2 { font-size: 17px; font-weight: 700; margin: 0 0 16px; }

.orders { display: grid; gap: 16px; }
.order {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm);
}
.order__head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.order__id { font-size: 15px; font-weight: 700; }
.order__date { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.pill {
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  white-space: nowrap; background: var(--surface-2); color: var(--text-2);
}
.pill--placed    { background: #e8f0ff; color: #1d4ed8; }
.pill--packed    { background: #fff3e0; color: #b45309; }
.pill--shipped   { background: #ede9fe; color: #6d28d9; }
.pill--delivered { background: var(--brand-soft); color: var(--brand-dark); }
.pill--ready     { background: var(--haldi-tint); color: var(--haldi-deep); }
.pill--collected { background: var(--brand-soft); color: var(--brand-dark); }
.pill--cancelled { background: var(--danger-soft); color: var(--danger); }
[data-theme="dark"] .pill--placed    { background: rgba(59,130,246,.18);  color: #93b8ff; }
[data-theme="dark"] .pill--packed    { background: rgba(245,158,11,.18);  color: #fbbf24; }
[data-theme="dark"] .pill--shipped   { background: rgba(139,92,246,.18);  color: #c4b5fd; }
[data-theme="dark"] .pill--delivered { background: rgba(46,160,67,.18);   color: #7ee2a8; }
[data-theme="dark"] .pill--ready     { background: rgba(138,198,64,.18);  color: var(--haldi-deep); }
[data-theme="dark"] .pill--collected { background: rgba(46,160,67,.18);   color: #7ee2a8; }
[data-theme="dark"] .pill--cancelled { background: rgba(220,38,38,.18);   color: #fca5a5; }

/* Progress rail */
.track { display: flex; margin: 0 0 18px; }
.track__step { flex: 1; position: relative; text-align: center; }
.track__step::before {
  content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px;
  background: var(--border);
}
.track__step:first-child::before { display: none; }
.track__step.is-done::before { background: var(--brand); }
.track__dot {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 24px; height: 24px; margin: 0 auto 6px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--border);
  font-size: 11px; color: #fff; font-weight: 700;
}
.track__step.is-done .track__dot { background: var(--brand); border-color: var(--brand); }
.track__label { font-size: 11px; color: var(--text-3); }
.track__step.is-done .track__label { color: var(--text); font-weight: 600; }
.track--cancelled {
  padding: 10px 12px; border-radius: 9px; margin-bottom: 16px;
  background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 600;
}

.order__items { border-top: 1px solid var(--border); padding-top: 13px; display: grid; gap: 9px; }
.order__item { display: grid; grid-template-columns: 24px 1fr auto auto; gap: 10px; align-items: center; font-size: 13.5px; }
.order__emoji { font-size: 17px; }
.order__name em { font-style: normal; color: var(--text-3); font-size: 12px; }
.order__qty { color: var(--text-3); font-size: 12.5px; }
.order__line { font-weight: 600; font-variant-numeric: tabular-nums; }

.order__foot {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); margin-top: 14px; padding-top: 13px;
}
.order__addr { font-size: 12.5px; color: var(--text-2); max-width: 55%; }
.order__totals { display: flex; gap: 12px; align-items: baseline; font-size: 12.5px; }
.order__save { color: var(--brand); font-weight: 600; }
.order__fee { color: var(--text-3); }
.order__total { font-size: 17px; font-weight: 800; }
.order__cancel { margin-top: 14px; width: 100%; }

.panels { display: grid; gap: 16px; }
@media (min-width: 800px) { .panels { grid-template-columns: 1fr 1fr; } }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
}
.panel h3 { font-size: 14.5px; font-weight: 700; margin: 0 0 16px; }

/* ---------------- My Yaadi (saved list) ---------------- */
.acct__count {
  font-size: 13px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: var(--r-pill);
  padding: 2px 10px; vertical-align: middle; margin-left: 6px;
}
.acct__hint { color: var(--text-2); font-size: 14px; margin: -6px 0 16px; }

.order__ready {
  background: var(--haldi-tint); color: var(--haldi-deep);
  border-radius: var(--r); padding: 9px 12px; font-size: 13.5px; margin: 4px 0 12px;
}
.order__ready b { font-weight: 800; }

.ful-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand); vertical-align: middle; margin-left: 8px;
}

.yaadi-list {
  display: grid; gap: 2px; border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; background: var(--surface);
}
.yaadi-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.yaadi-row:last-child { border-bottom: 0; }
.yaadi-row.is-gone { opacity: .55; }
.yaadi-row__emoji {
  width: 40px; height: 40px; flex: none; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: var(--surface-2);
}
.yaadi-row__emoji img { width: 100%; height: 100%; object-fit: cover; }
.yaadi-row__main { flex: 1; min-width: 0; }
.yaadi-row__name { font-weight: 600; font-size: 14.5px; }
.yaadi-row__meta { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.yaadi-row__gone { color: var(--danger); font-weight: 600; }

.qty--sm { display: inline-flex; align-items: center; gap: 2px; flex: none;
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 2px; }
.qty--sm .qty__btn {
  width: 28px; height: 28px; border: 0; background: none; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--brand); border-radius: var(--r-pill);
}
.qty--sm .qty__btn:hover { background: var(--brand-soft); }
.qty--sm .qty__n { min-width: 22px; text-align: center; font-weight: 700; font-size: 13.5px; }

.yaadi-row__x {
  width: 30px; height: 30px; flex: none; border: 0; background: none; cursor: pointer;
  color: var(--text-3); font-size: 14px; border-radius: var(--r-pill);
}
.yaadi-row__x:hover { background: var(--danger-soft); color: var(--danger); }

.yaadi-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.yaadi-foot .btn { flex: 0 0 auto; }
