/* ============================================================
   Day Designs — Account & Login Styles
   Matches main site design system: Fraunces + Inter Tight,
   --bg #f5f1ea, --fg #0f0f0e, --accent #2b3a2e
   ============================================================ */

:root {
  --bg:      #f5f1ea;
  --fg:      #0f0f0e;
  --muted:   #6b665e;
  --line:    #d8d2c5;
  --accent:  #2b3a2e;
  --surface: #eee8df;
  --display: 'Inter Tight', system-ui, sans-serif;
  --body:    'Inter', system-ui, sans-serif;
  --accent-font: 'Fraunces', serif;

  --status-processing-bg:  #fef9c3;
  --status-processing-fg:  #854d0e;
  --status-shipped-bg:     #dbeafe;
  --status-shipped-fg:     #1e40af;
  --status-delivered-bg:   #dcfce7;
  --status-delivered-fg:   #166534;
  --status-cancelled-bg:   #fee2e2;
  --status-cancelled-fg:   #991b1b;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ===== HEADER (shared with site) ===== */
header.site {
  padding: 20px 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}
header.site .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
header.site .brand-name { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
header.site nav { display: flex; gap: 28px; font-size: 13px; }
header.site nav a { text-decoration: none; }
header.site nav a:hover { opacity: 0.6; }
header.site .right { display: flex; gap: 18px; font-size: 13px; justify-content: flex-end; align-items: center; }
header.site .right a { text-decoration: none; }
header.site .right a:hover { opacity: 0.6; }

.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-toggle button {
  padding: 5px 11px; border-radius: 999px; border: none; cursor: pointer;
  background: transparent; color: var(--muted);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 10px; letter-spacing: 0.1em; transition: all .2s;
}
.lang-toggle button.active { background: var(--fg); color: var(--bg); }
.bag-link { display: inline-flex; align-items: center; gap: 6px; }

/* ===== FOOTER ===== */
footer.site { padding: 80px 48px 32px; border-top: 1px solid var(--line); }
.ftr-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 64px; }
.ftr-grid .brand-name { display: block; }
.ftr-grid h5 {
  color: var(--muted); margin: 0 0 16px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 400;
}
.ftr-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ftr-grid ul a { text-decoration: none; font-size: 14px; }
.ftr-grid ul a:hover { opacity: 0.6; }
.ftr-tag { font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.15; max-width: 420px; letter-spacing: -0.02em; }
.ftr-bottom {
  display: flex; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--muted); font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px;
  font-size: 13px; letter-spacing: 0.04em; font-weight: 500; font-family: var(--body);
  text-decoration: none; transition: background .2s ease, color .2s ease;
  cursor: pointer; border: none;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid currentColor; }
.btn-ghost:hover { background: var(--fg); color: var(--bg); }
.btn-sm { padding: 9px 16px; font-size: 12px; }
.btn-danger { background: #991b1b; color: #fff; }
.btn-danger:hover { background: #7f1d1d; }

/* ===== HAMBURGER ===== */
.ham-btn {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px; background: none; border: none; cursor: pointer; padding: 4px;
  color: #0f0f0e; -webkit-appearance: none;
}
.ham-btn span { display: block; width: 22px; height: 2px; background: currentColor; transition: transform .25s, opacity .25s; }

/* ===== MOBILE DRAWER ===== */
.mob-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 900; }
.mob-overlay.open { display: block; }
.mob-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px;
  background: var(--bg); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .3s ease;
  z-index: 901; display: flex; flex-direction: column; overflow-y: auto;
}
.mob-drawer.open { transform: translateX(0); }
.mob-drawer-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); min-height: 56px;
}
.mob-drawer-top a { text-decoration: none; }
.mob-close { background: none; border: none; cursor: pointer; padding: 4px; color: inherit; display: flex; align-items: center; }
.mob-nav { display: flex; flex-direction: column; flex: 1; }
.mob-nav a {
  padding: 16px 24px; font-size: 15px; text-decoration: none; color: var(--fg);
  border-bottom: 1px solid var(--line); letter-spacing: .02em; transition: background .15s;
}
.mob-nav a:hover { background: var(--surface); }
.mob-drawer-foot { padding: 20px 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.mob-drawer-foot a { font-size: 13px; text-decoration: none; color: var(--fg); }

/* ===== BREADCRUMB ===== */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 48px;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  padding: 10px 0;
}
.breadcrumb a { text-decoration: none; color: inherit; }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb-sep { opacity: 0.4; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: calc(100vh - 65px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 24px 80px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: #fff; border: 1px solid var(--line);
  padding: 40px 40px 48px;
}
.login-card-title {
  font-family: var(--display); font-weight: 500; font-size: 28px;
  letter-spacing: -0.02em; margin: 0 0 6px;
}
.login-card-sub { font-size: 14px; color: var(--muted); margin: 0 0 32px; line-height: 1.5; }

/* Tab switcher */
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.auth-tab {
  flex: 1; padding: 12px 0; font-size: 13px; letter-spacing: 0.04em; font-weight: 500;
  background: none; border: none; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s;
  font-family: var(--body);
}
.auth-tab.active { color: var(--fg); border-bottom-color: var(--fg); }
.auth-tab:hover:not(.active) { color: var(--fg); }

/* Forms */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

.field-group { margin-bottom: 18px; }
.field-group label {
  display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.field-group input {
  display: block; width: 100%; padding: 11px 14px;
  background: var(--bg); border: 1px solid var(--line); color: var(--fg);
  font-family: var(--body); font-size: 15px; outline: none;
  transition: border-color .2s;
}
.field-group input:focus { border-color: var(--fg); }
.field-group input::placeholder { color: var(--muted); opacity: 0.6; }

.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.forgot-link { font-size: 12px; color: var(--muted); text-decoration: none; float: right; margin-top: -12px; margin-bottom: 18px; display: block; text-align: right; }
.forgot-link:hover { color: var(--fg); }

.auth-submit { width: 100%; justify-content: center; margin-top: 8px; }

/* Divider */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-family: ui-monospace, 'SF Mono', Menlo, monospace; white-space: nowrap; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Google button */
.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; background: #fff; border: 1px solid var(--line); cursor: pointer;
  font-family: var(--body); font-size: 14px; font-weight: 500; color: var(--fg);
  transition: background .2s, border-color .2s;
}
.btn-google:hover { background: var(--bg); border-color: var(--fg); }
.btn-google svg { flex-shrink: 0; }

/* Error / success messages */
.auth-msg {
  padding: 11px 14px; font-size: 13px; line-height: 1.45; margin-bottom: 16px; display: none;
}
.auth-msg.error { background: var(--status-cancelled-bg); color: var(--status-cancelled-fg); border: 1px solid #fca5a5; }
.auth-msg.success { background: var(--status-delivered-bg); color: var(--status-delivered-fg); border: 1px solid #86efac; }
.auth-msg.show { display: block; }

/* Password strength hint */
.pw-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   ACCOUNT DASHBOARD
   ============================================================ */
.account-page { padding: 24px 48px 80px; max-width: 1100px; margin: 0 auto; }
.account-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 48px; flex-wrap: wrap; gap: 16px; }
.account-welcome {
  font-family: var(--display); font-weight: 500; font-size: 36px;
  letter-spacing: -0.02em; margin: 0;
}
.account-welcome .ital { font-family: var(--accent-font); font-style: italic; font-weight: 300; }

/* Section titles */
.acct-section { margin-bottom: 56px; }
.acct-section-title {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}

/* ===== ORDERS TABLE ===== */
.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th {
  text-align: left; padding: 10px 14px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); font-weight: 400;
}
.orders-table td { padding: 16px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.orders-table tr:last-child td { border-bottom: none; }
.orders-table tr:hover td { background: var(--surface); }

/* Clickable order rows */
.order-row { cursor: pointer; }
.order-row.expanded td { background: var(--surface); }
.order-chevron {
  float: right; font-size: 12px; color: var(--muted);
  transition: transform 0.2s ease; display: inline-block;
}
.order-row.expanded .order-chevron { transform: rotate(180deg); }

/* Expandable detail row */
.order-detail-row { display: none; }
.order-detail-row.open { display: table-row; }
.order-detail-row td { padding: 0 !important; border-bottom: 1px solid var(--line); }

.order-detail-panel {
  padding: 20px 14px 24px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 16px;
}

/* Items list */
.order-detail-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.order-detail-item:last-child { border-bottom: none; }
.order-detail-item-name { flex: 1; }
.order-detail-item-qty  { color: var(--muted); font-size: 13px; }
.order-detail-item-price { font-weight: 500; min-width: 60px; text-align: right; }

/* Shipping address */
.order-detail-addr {
  font-size: 13px; line-height: 1.6; color: var(--muted);
}
.order-detail-label {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}

/* Total row */
.order-detail-total {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--line);
  font-weight: 500; font-size: 14px;
}

.order-num { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; letter-spacing: 0.06em; }
.order-items-list { display: flex; flex-direction: column; gap: 2px; }
.order-items-list span { font-size: 13px; color: var(--muted); }
.order-items-list span:first-child { font-size: 14px; color: var(--fg); }
.order-total { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.order-date { font-size: 12px; color: var(--muted); font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* Status badges */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em; white-space: nowrap;
}
.status-badge.processing  { background: var(--status-processing-bg); color: var(--status-processing-fg); }
.status-badge.shipped     { background: var(--status-shipped-bg);    color: var(--status-shipped-fg); }
.status-badge.delivered   { background: var(--status-delivered-bg);  color: var(--status-delivered-fg); }
.status-badge.cancelled   { background: var(--status-cancelled-bg);  color: var(--status-cancelled-fg); }

/* Empty state */
.orders-empty {
  padding: 48px 0; text-align: center; color: var(--muted);
  font-size: 15px; border: 1px dashed var(--line);
}
.orders-empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
.orders-empty p { margin: 4px 0; }
.orders-empty .orders-empty-sub { font-size: 13px; margin-top: 8px; }
.orders-empty .btn { margin-top: 20px; }

/* Loading skeleton */
.skeleton-row { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.skeleton-cell { height: 14px; background: var(--line); border-radius: 2px; opacity: 0.5; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }

/* ===== SAVED ADDRESS ===== */
.address-box {
  background: var(--surface); border: 1px solid var(--line); padding: 24px 28px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap;
}
.address-display { font-size: 15px; line-height: 1.7; }
.address-display .address-name { font-weight: 600; margin-bottom: 2px; }
.address-display .address-empty { color: var(--muted); font-style: italic; font-size: 14px; }

/* ===== ADDRESS CARDS ===== */
.address-card {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; padding: 20px 24px; border: 1px solid var(--line);
  background: var(--surface); margin-bottom: 12px; flex-wrap: wrap;
}
.address-card-body { flex: 1; font-size: 14px; line-height: 1.7; }
.address-card-name { font-weight: 600; margin-bottom: 2px; }
.address-card-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; flex-wrap: wrap; }
.addr-default-badge {
  display: inline-block; padding: 2px 8px; font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--fg); color: var(--bg);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; margin-bottom: 6px;
}

/* Address add/edit form */
.address-form { display: none; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 24px; }
.address-form.open { display: block; }
.address-form-title { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 20px; }
.address-form .field-group { margin-bottom: 16px; }
.address-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.address-form-actions { display: flex; gap: 12px; margin-top: 24px; }
.addr-form-error {
  padding: 10px 14px; font-size: 13px; background: var(--status-cancelled-bg);
  color: var(--status-cancelled-fg); border: 1px solid #fca5a5; margin-bottom: 16px;
}

/* Required field star */
.req-star { color: #991b1b; }

/* ===== DANGER ZONE ===== */
.danger-zone { margin-top: 48px; padding-top: 32px; border-top: 1px solid #fca5a5; }
.danger-zone .acct-section-title { color: #991b1b; border-bottom-color: #fca5a5; }
.danger-zone-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 20px 24px; border: 1px solid #fca5a5;
  background: #fff5f5; flex-wrap: wrap;
}
.danger-zone-label { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: #991b1b; }
.danger-zone-sub   { font-size: 13px; color: #7f1d1d; margin: 0; line-height: 1.5; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  header.site { grid-template-columns: 44px 1fr 44px !important; padding: 0 12px !important; height: 56px; }
  header.site .brand { grid-column: 2; justify-content: center; }
  header.site > nav { display: none !important; }
  header.site .right > *:not(.bag-link) { display: none; }
  header.site .right { grid-column: 3; justify-content: flex-end; }
  .ham-btn { display: flex; }

  footer.site { padding: 40px 20px 24px !important; }
  .ftr-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .ftr-bottom { flex-direction: column; gap: 10px; text-align: center; }

  /* Breadcrumb */
  .breadcrumb-bar { padding: 0 16px; background: var(--surface); }

  /* Login */
  .login-page { padding: 32px 16px 60px; align-items: flex-start; }
  .login-card { padding: 28px 20px 36px; }
  .login-card-title { font-size: 22px; }
  .field-row-2 { grid-template-columns: 1fr; }

  /* Account */
  .account-page { padding: 28px 16px 60px; }
  .account-welcome { font-size: 26px; }
  .orders-table { display: block; }
  .orders-table thead { display: none; }
  .orders-table tbody { display: block; }
  .orders-table tr { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .orders-table tr:hover td { background: transparent; }
  .orders-table td { display: block; padding: 4px 0; border-bottom: none; }
  .order-detail-row { display: none; }
  .order-detail-row.open { display: block; }
  .order-detail-row td { display: block; padding: 0 !important; }
  .orders-table td::before {
    content: attr(data-label);
    font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 10px;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
    display: block; margin-bottom: 2px;
  }
  .address-form-row { grid-template-columns: 1fr; }
  .address-card { flex-direction: column; gap: 12px; }
  .address-card-actions { flex-direction: row; }
}

@media (max-width: 480px) {
  .address-form-actions { flex-direction: column; }
  .address-form-actions .btn { width: 100%; justify-content: center; }
  .account-header { flex-direction: column; align-items: flex-start; }
}
