:root {
  --espresso: #1a1209;
  --cream: #f7f2ea;
  --caramel: #c9a66b;
  --mocha: #6b5d4f;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --radius: 12px;
  --border: rgba(26, 18, 9, 0.12);
}

* { box-sizing: border-box; }

body.account-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--espresso);
  padding: 1rem 1.25rem 2.5rem;
  display: flex;
  justify-content: center;
}

.account-shell {
  width: 100%;
  max-width: 680px;
}

.account-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.account-back {
  color: var(--mocha);
  text-decoration: none;
  font-size: 0.9rem;
}

.account-back:hover { color: var(--espresso); }

.account-profile {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(26, 18, 9, 0.06);
  border: 1px solid var(--border);
}

.account-avatar {
  flex-shrink: 0;
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: rgba(74, 55, 40, 0.08);
  color: var(--espresso);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.account-avatar.is-verified {
  overflow: visible;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.avatar-verified-badge {
  position: absolute;
  right: -0.06rem;
  bottom: -0.06rem;
  width: 34%;
  height: 34%;
  min-width: 1.05rem;
  min-height: 1.05rem;
  max-width: 1.5rem;
  max-height: 1.5rem;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #1d9bf0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(26, 18, 9, 0.06);
  z-index: 1;
  pointer-events: none;
}

.avatar-verified-badge svg {
  width: 62%;
  height: 62%;
  fill: #fff;
  display: block;
}

.account-avatar--photo {
  background: #e8dfd0;
  color: var(--espresso);
}

.account-profile-text {
  min-width: 0;
}

.account-profile h1 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  line-height: 1.15;
  word-break: break-word;
}

.account-email {
  margin: 0;
  color: var(--mocha);
  font-size: 0.92rem;
  word-break: break-all;
}

.account-section {
  margin-bottom: 1.5rem;
  padding: 1.35rem;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(26, 18, 9, 0.04);
}

.account-section--last {
  margin-bottom: 0;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.section-lead {
  margin: 0 0 1rem;
  color: var(--mocha);
  font-size: 0.88rem;
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.account-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: 2.75rem;
  font-size: 0.95rem;
}

.account-orders-grid {
  display: grid;
  gap: 1.5rem;
}

.account-oauth-note {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--mocha);
}

.recent-orders-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-recent-toggle {
  width: 100%;
  justify-content: center;
}

#recent-orders-list:not(.hidden) {
  width: 100%;
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.account-modal.is-open {
  display: flex;
}

.account-modal[hidden] {
  display: none !important;
}

.account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 18, 9, 0.45);
}

.account-modal-panel {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(26, 18, 9, 0.2);
}

.account-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.account-modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.account-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--mocha);
  padding: 0.15rem 0.35rem;
}

.account-modal-close:hover {
  color: var(--espresso);
}

body.account-modal-open {
  overflow: hidden;
}

.account-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.account-form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid rgba(26, 18, 9, 0.2);
  border-radius: 8px;
  background: #fff;
  min-height: 2.75rem;
}

.account-form input:focus {
  outline: 2px solid var(--caramel);
  outline-offset: 1px;
}

.form-feedback {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #e8f5e9;
  color: #2e7d32;
}

.form-feedback.error {
  background: #ffebee;
  color: #c62828;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 2.75rem;
}

.btn-primary {
  background: var(--espresso);
  color: var(--cream);
}

.btn-ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--espresso);
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

.hidden { display: none !important; }

.muted {
  color: var(--mocha);
  font-size: 0.92rem;
}

.muted a {
  color: var(--espresso);
  font-weight: 500;
}

.orders-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-history-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--cream);
}

.order-history-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.order-history-meta {
  font-size: 0.8rem;
  color: var(--mocha);
  margin: 0 0 0.5rem;
}

.order-history-items {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.order-history-items li + li {
  margin-top: 0.25rem;
}

.status-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #fff3e0;
  color: #e65100;
}

.status-pill.done {
  background: #eceff1;
  color: #546e7a;
}

/* Login page styles (shared file) */
.account-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 12px 40px rgba(26, 18, 9, 0.08);
  margin: 1rem auto 2rem;
}

body.account-page:has(.account-card) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.25rem;
  gap: 0.5rem;
}

.account-logo {
  max-height: 72px;
  max-width: 160px;
  object-fit: contain;
}

.account-logo-fallback {
  font-size: 2.5rem;
  line-height: 1;
}

.account-shop-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--espresso);
}

.account-card h1 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 2rem;
}

.account-sub {
  margin: 0 0 1.5rem;
  color: var(--mocha);
  font-size: 0.95rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab {
  flex: 1;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-body);
  cursor: pointer;
}

.tab.active {
  background: var(--espresso);
  color: var(--cream);
  border-color: var(--espresso);
}

.panel-form { display: none; }
.panel-form.active { display: block; }

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.btn-social {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--espresso);
  gap: 0.65rem;
  font-weight: 500;
  position: relative;
}

.btn-social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.btn-social--google .btn-social-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E");
}

.btn-social--apple {
  background: #000;
  color: #fff;
  border-color: #000;
}

.btn-social--apple .btn-social-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='white'%3E%3Cpath d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 25 158.9 25 220.8c0 28.6 4.9 58.9 14.6 91 12.3 38.8 56.9 133.9 103.4 133.4 19.5-.3 33.3-13.9 58.7-13.9 24.9 0 37.1 13.9 58.7 13.9 46.6-.5 90.4-92.1 102.6-130.8-67.8-32.1-57.4-92.3-34.7-107.1zM256.2 87.6c16.2-19.7 27.2-47.1 24.2-74.4-23.5 1-52 15.6-68.9 35.5-15.1 17.8-28.3 46.3-24.7 73.7 26.2 2 52.9-14.4 69.4-34.6z'/%3E%3C/svg%3E");
}

.btn-social--facebook {
  background: #1877f2;
  color: #fff;
  border-color: #1877f2;
}

.btn-social--facebook .btn-social-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512' fill='white'%3E%3Cpath d='M279.14 288l14.22-92.66h-88.91V127.78c0-25.35 12.42-50.06 52.24-50.06h40.68V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z'/%3E%3C/svg%3E");
}

.form-error {
  padding: 0.65rem 0.85rem;
  background: #ffebee;
  color: #c62828;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.divider {
  text-align: center;
  color: var(--mocha);
  font-size: 0.85rem;
  margin: 1rem 0;
}

.divider span {
  background: #fff;
  padding: 0 0.75rem;
  position: relative;
}

.divider::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--border);
  margin-top: -0.65rem;
}

@media (min-width: 768px) {
  body.account-page {
    padding: 2rem 2.5rem 3rem;
  }

  .account-shell {
    max-width: 760px;
  }

  .account-profile {
    padding: 1.35rem 1.75rem;
  }

  .account-avatar {
    width: 5rem;
    height: 5rem;
    font-size: 1.25rem;
  }

  .account-profile h1 {
    font-size: 2.25rem;
  }

  .account-email {
    font-size: 1rem;
  }

  .section-heading {
    font-size: 1.5rem;
  }

  .section-lead {
    font-size: 0.95rem;
  }

  .account-orders-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .account-section--last {
    margin-bottom: 0;
  }
}

@media (max-width: 540px) {
  body.account-page {
    padding: 0.85rem 0.85rem 2rem;
  }

  .account-actions {
    grid-template-columns: 1fr;
  }

  .account-profile {
    padding: 1rem;
  }
}

.account-subheading {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.account-roulette {
  margin-top: 0.75rem;
  padding: 1.25rem 1rem 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.account-roulette.hidden {
  display: none;
}

.account-roulette-stage {
  align-items: center;
}

.account-roulette-progress {
  margin: 0;
  font-size: 0.9rem;
  color: var(--mocha);
  text-align: center;
}

.account-voucher-history {
  margin-top: 1.25rem;
}

.account-voucher-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-voucher-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.account-voucher-date {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--mocha);
}

.account-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.25rem;
}

.account-name-row h1 {
  margin: 0;
}

.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}

.account-badge--verified {
  background: #1a6b3c;
  color: #fff;
}

.account-badge--pwd {
  background: #2563eb;
  color: #fff;
}

.account-badge--senior {
  background: #b45309;
  color: #fff;
}

.verify-card {
  margin-top: 0.85rem;
  padding: 1rem 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.verify-card + .verify-card {
  margin-top: 0.75rem;
}

.verify-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
}

.verify-card-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.verify-card-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--mocha);
  line-height: 1.45;
}

.verify-status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.verify-status-pill--pending {
  background: #fef3c7;
  color: #92400e;
}

.verify-status-pill--approved {
  background: #d1fae5;
  color: #065f46;
}

.verify-status-pill--rejected {
  background: #fee2e2;
  color: #991b1b;
}

.verify-approved-note,
.verify-pending-note,
.verify-rejected-note {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.verify-approved-note {
  background: #ecfdf5;
  color: #065f46;
}

.verify-pending-note {
  background: #fffbeb;
  color: #92400e;
}

.verify-rejected-note {
  background: #fef2f2;
  color: #991b1b;
}

.verify-approved-note p,
.verify-pending-note p,
.verify-rejected-note p {
  margin: 0;
}

.verify-form {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

.verify-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.verify-form input[type="text"] {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.verify-upload input[type="file"] {
  font-size: 0.85rem;
}

.verify-upload-row {
  display: grid;
  gap: 0.35rem;
}

.verify-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.65rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #faf8f5;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--espresso);
}

.verify-upload-btn:hover {
  background: #f3ede4;
  border-color: var(--mocha);
}

.verify-upload-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.verify-upload-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--mocha);
}

.verify-preview {
  max-width: 280px;
}

.verify-preview img {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}
