/* ═══════════════════════════════════════════════════════
   account.css — Login, signup, and account dashboard
   ═══════════════════════════════════════════════════════ */

/* ─── AUTH PAGES (login / signup) ───────────────────── */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-logo img {
  height: 40px;
  filter: none; /* logo shown in natural colour on card */
}
[data-theme="dark"] .auth-logo img {
  filter: brightness(0) invert(1);
}

.auth-title {
  font-family: var(--font-d);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-align: center;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Google button */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface-3);
  color: var(--text-1);
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t);
  margin-bottom: 20px;
}
.btn-google:hover {
  border-color: var(--text-1);
  background: var(--surface-2);
}
.btn-google img { width: 20px; height: 20px; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Form fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.auth-input {
  font-family: var(--font-b);
  font-size: 15px;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  width: 100%;
}
.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(106,18,190,0.1);
}
.auth-input::placeholder { color: rgba(138,129,120,0.5); }

/* Submit button */
.btn-auth-submit {
  width: 100%;
  background: var(--accent);
  color: white;
  font-family: var(--font-d);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 14px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all var(--t);
  margin-top: 4px;
}
.btn-auth-submit:hover {
  background: var(--text-1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(106,18,190,0.25);
}
.btn-auth-submit:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Error / success messages */
.auth-message {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  margin-top: 4px;
  display: none;
}
.auth-message.error {
  display: block;
  background: rgba(200,50,50,0.08);
  border: 1px solid rgba(200,50,50,0.2);
  color: #c03030;
}
.auth-message.success {
  display: block;
  background: rgba(42,96,73,0.08);
  border: 1px solid rgba(42,96,73,0.2);
  color: var(--accent2);
}

/* Switch link */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-2);
}
.auth-switch a {
  color: var(--accent);
  font-weight: 700;
  transition: color var(--t);
}
.auth-switch a:hover { color: var(--text-1); }

/* Forgot password */
.auth-forgot {
  text-align: right;
  margin-top: -6px;
}
.auth-forgot a {
  font-size: 13px;
  color: var(--text-2);
  transition: color var(--t);
}
.auth-forgot a:hover { color: var(--accent); }

/* Loading spinner inline */
.auth-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

/* ─── ACCOUNT DASHBOARD ──────────────────────────────── */
.account-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px 80px;
  position: relative;
  z-index: 1;
}

/* Header row */
.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.account-greeting {
  font-family: var(--font-d);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-greeting span { color: var(--accent); }

.btn-signout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-d);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t);
}
.btn-signout:hover { border-color: var(--text-1); color: var(--text-1); }

/* Tab navigation */
.account-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.account-tabs::-webkit-scrollbar { display: none; }

.account-tab {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color var(--t);
}
.account-tab::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--t);
  border-radius: 1px;
}
.account-tab:hover { color: var(--text-1); }
.account-tab.active { color: var(--accent); }
.account-tab.active::after { transform: scaleX(1); }

/* Tab panels */
.account-panel { display: none; }
.account-panel.active { display: block; }

/* ── Orders panel ── */
.order-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 16px;
  transition: box-shadow var(--t);
}
.order-card:hover { box-shadow: var(--shadow); }

.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.order-id {
  font-family: var(--font-d);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}
.order-date { font-size: 12px; color: var(--text-2); }

.order-status {
  font-family: var(--font-d);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
}
.order-status.pending   { background: rgba(212,168,75,0.12); color: #b8860b; }
.order-status.confirmed { background: rgba(42,96,73,0.10);   color: var(--accent2); }
.order-status.shipped   { background: rgba(106,18,190,0.10); color: var(--accent); }
.order-status.delivered { background: rgba(42,96,73,0.15);   color: var(--accent2); }

.order-card-body { padding: 16px 20px; }

.order-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.order-item-row:last-child { border-bottom: none; }
.order-item-name { flex: 1; color: var(--text-1); font-weight: 500; }
.order-item-meta { font-size: 12px; color: var(--text-2); }
.order-item-price { font-family: var(--font-d); font-weight: 700; color: var(--text-1); }

.order-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.order-total-label { font-size: 13px; color: var(--text-2); }
.order-total-val { font-family: var(--font-d); font-size: 18px; font-weight: 700; color: var(--text-1); }

/* ── Wishlist panel ── */
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.wishlist-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: all var(--t);
}
.wishlist-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.wishlist-img {
  aspect-ratio: 1;
  background: var(--surface-2);
  overflow: hidden;
}
.wishlist-img img { width: 100%; height: 100%; object-fit: cover; }

.wishlist-info { padding: 12px 14px; }
.wishlist-name {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
  line-height: 1.3;
}
.wishlist-price { font-size: 13px; color: var(--accent); font-weight: 700; }

.wishlist-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}
.btn-wishlist-view {
  flex: 1;
  padding: 8px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t);
  text-align: center;
  text-decoration: none;
  display: block;
}
.btn-wishlist-view:hover { background: var(--text-1); color: var(--surface-1); }
.btn-wishlist-remove {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--t);
  flex-shrink: 0;
}
.btn-wishlist-remove:hover { background: rgba(200,50,50,0.08); color: #c03030; border-color: #c03030; }

/* ── Profile panel ── */
.profile-form {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-section-title {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-label {
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.profile-input {
  font-family: var(--font-b);
  font-size: 15px;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--t);
  width: 100%;
}
.profile-input:focus { border-color: var(--accent); }
.profile-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-save-profile {
  width: fit-content;
  background: var(--accent);
  color: white;
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all var(--t);
  margin-top: 8px;
}
.btn-save-profile:hover { background: var(--text-1); transform: translateY(-2px); }

/* ── Recently viewed panel ── */
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

/* Empty states */
.account-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-2);
}
.account-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.account-empty h3 {
  font-family: var(--font-d);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}
.account-empty p { font-size: 14px; margin-bottom: 20px; }

/* Loading skeleton */
.skeleton {
  background: var(--border);
  border-radius: var(--r-sm);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { opacity: 0.5; }
  50%  { opacity: 1; }
  100% { opacity: 0.5; }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-card { padding: 32px 24px; }
  .account-wrap { padding: 28px 20px 60px; }
  .account-tabs { gap: 0; }
  .account-tab { padding: 10px 14px; font-size: 13px; }
  .wishlist-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .recent-grid { grid-template-columns: repeat(2, 1fr); }
}
