:root {
  --ink: #1f1c17;
  --cream: #f7f2e9;
  --paper: #fffdf8;
  --gold: #b88b3e;
  --gold-dark: #8b6528;
  --muted: #6f675c;
  --line: #ded3c2;
  --success: #2f6b4f;
  --danger: #9e3d35;
  --pending: #996a1e;
  --shadow: 0 16px 48px rgba(45, 35, 22, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.account-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px clamp(20px, 5vw, 70px);
  color: #fff;
  background: rgba(31, 28, 23, .98);
  border-bottom: 1px solid rgba(184, 139, 62, .35);
}
.account-logo {
  font-family: Georgia, serif;
  font-size: 20px;
  letter-spacing: .08em;
  text-decoration: none;
}
.account-logo span { color: #d6ae68; }
.account-nav { display: flex; align-items: center; gap: 18px; }
.account-nav a { color: #eee7dc; font-size: 14px; text-decoration: none; }
.account-nav a[aria-current="page"] { color: #d6ae68; }

.account-shell { width: min(1120px, calc(100% - 32px)); margin: 46px auto 80px; }
.account-intro { max-width: 720px; margin-bottom: 28px; }
.account-kicker { color: var(--gold-dark); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { font-family: Georgia, serif; font-weight: 500; line-height: 1.15; }
h1 { margin: 8px 0 12px; font-size: clamp(34px, 6vw, 56px); }
h2 { margin: 0 0 18px; font-size: clamp(25px, 4vw, 34px); }
h3 { margin: 0 0 12px; font-size: 21px; }
.account-intro p, .muted { color: var(--muted); }

.account-card {
  padding: clamp(22px, 4vw, 36px);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.auth-card { max-width: 650px; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 24px; }
.stack { display: grid; gap: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: grid; gap: 7px; }
.form-field.wide { grid-column: 1 / -1; }
label { color: #4d463c; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cabdaa;
  border-radius: 2px;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(184, 139, 62, .22); border-color: var(--gold); }
input[readonly] { color: var(--muted); background: #f2ede4; }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 17px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-weight: 750;
  text-decoration: none;
}
.button:hover { background: #383127; }
.button.primary { color: #211c14; background: #d5ac64; border-color: #d5ac64; }
.button.secondary { color: var(--ink); background: transparent; border-color: #bcae99; }
.button.danger { color: var(--danger); background: transparent; border-color: #caa9a5; }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.button:disabled { cursor: wait; opacity: .55; }

.auth-tabs { display: flex; gap: 8px; margin: 0 0 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.auth-tab { padding: 8px 11px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--ink); border-color: var(--gold); }
.auth-panel { display: grid; gap: 16px; }
.text-action { padding: 0; color: var(--gold-dark); background: none; border: 0; text-decoration: underline; }

.notice {
  margin: 0 0 20px;
  padding: 13px 15px;
  color: #4e463b;
  background: #f4eee3;
  border-left: 3px solid var(--gold);
}
.notice.success { color: var(--success); background: #eef7f2; border-color: var(--success); }
.notice.error { color: var(--danger); background: #fbefee; border-color: var(--danger); }
.notice:empty { display: none; }

.status-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: capitalize; }
.badge.pending { color: #714b0c; background: #f7e8c9; }
.badge.approved, .badge.authorized, .badge.captured, .badge.completed { color: #22543d; background: #dcefe5; }
.badge.suspended, .badge.failed, .badge.cancelled, .badge.voided { color: #81342d; background: #f6dfdc; }
.badge.standard, .badge.received, .badge.processing, .badge.confirmed { color: #4f493f; background: #e9e2d8; }
.badge.bronze, .badge.silver, .badge.gold { color: #664817; background: #f2dfb8; }

.account-meta { display: grid; gap: 13px; margin: 0; }
.account-meta div { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid #e9e1d5; }
.account-meta dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.account-meta dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.readonly-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; }

.address-list { display: grid; gap: 12px; margin-bottom: 22px; }
.address-card { padding: 16px; background: #faf7f1; border: 1px solid var(--line); }
.address-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.address-card p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; border: 1px dashed #cbbda9; }

.orders-list { display: grid; gap: 18px; }
.order-card { padding: 22px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(45,35,22,.06); }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.order-reference { margin: 0 0 5px; font-family: Georgia, serif; font-size: 22px; }
.order-date { color: var(--muted); font-size: 13px; }
.order-total { text-align: right; font-weight: 850; }
.order-total small { display: block; color: var(--muted); font-weight: 500; }
.order-items { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.order-items li { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid #eee7dc; font-size: 14px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.loading-state { display: flex; align-items: center; gap: 11px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid #d7cbb9; border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .account-grid { grid-template-columns: 1fr; }
  .account-nav a:not([aria-current="page"]) { display: none; }
}
@media (max-width: 580px) {
  .account-shell { width: min(100% - 20px, 1120px); margin-top: 28px; }
  .account-topbar { padding: 13px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.wide { grid-column: auto; }
  .order-head { display: grid; }
  .order-total { text-align: left; }
  .order-items li { display: grid; gap: 2px; }
}

