/* ============================================================
   shared.css  —  User Account Section
   Inherits site design system:
     --primary:   #5B8C51  (green)
     --secondary: #EDDD5E  (yellow)
     --light:     #F7F7F7
     --dark:      #404A3D
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #5B8C51;
  --secondary:  #EDDD5E;
  --light:      #F7F7F7;
  --dark:       #404A3D;

  /* Extended palette derived from site colours */
  --primary-dk: #4a7342;
  --primary-lt: #eaf3e8;
  --dark-lt:    #5a6655;
  --border:     #dcdcdc;
  --muted:      #777777;
  --paper:      #ffffff;
  --bg:         #F7F7F7;
  --danger:     #dc3545;
  --success:    #4a8c5c;

  --radius:    10px;
  --radius-lg: 14px;
  --shadow-sm: 0 0 20px rgba(0,0,0,.06);
  --shadow-md: 0 0 45px rgba(0,0,0,.09);
  --shadow-lg: 0 15px 40px rgba(0,0,0,.12);
  --trans: .3s;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--dark);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 { color: var(--dark); font-weight: 700; line-height: 1.25; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p  { color: var(--muted); }
a  { color: var(--primary); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--primary-dk); }

/* ── Layout ── */
.container  { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.flex       { display: flex; }
.flex-center{ display: flex; align-items: center; justify-content: center; }
.gap-8      { gap: 8px; }
.gap-16     { gap: 16px; }
.mt-8       { margin-top: 8px; }
.mt-16      { margin-top: 16px; }
.mt-24      { margin-top: 24px; }
.text-center{ text-align: center; }
.text-muted { color: var(--muted); font-size: 13px; }

/* ── Card ── */
.card { background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border: none; }
.card-body { padding: 32px; }

/* ── Forms — mirrors .checkout-input ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 7px;
}
.form-control {
  width: 100%;
  height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  color: var(--dark);
  transition: border-color var(--trans), box-shadow var(--trans);
  outline: none;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,140,81,.14);
}
.form-control::placeholder { color: #b0b0b0; }
.form-control:disabled     { background: var(--light); cursor: not-allowed; opacity: .75; }
textarea.form-control      { height: auto; resize: vertical; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

/* ── Buttons — mirrors site .btn / .checkout-btn ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  height: 48px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--trans);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: var(--light); }
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dk);
  color: var(--light);
  box-shadow: 0 4px 14px rgba(91,140,81,.35);
  transform: translateY(-1px);
}

.btn-secondary { background: var(--secondary); color: var(--dark); }
.btn-secondary:hover:not(:disabled) { background: #d9c94e; color: var(--dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary); color: var(--light); }

.btn-ghost  { background: var(--light); color: var(--dark); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: #ebebeb; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b52d3a; }

.btn-full { width: 100%; }
.btn-sm   { padding: 7px 16px; font-size: 13px; height: 36px; }

/* Google */
.btn-google {
  background: #fff;
  color: var(--dark);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-google:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-google img   { width: 18px; height: 18px; }

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

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideDown .2s ease;
}
.alert-error   { background: #fdecea; border: 1px solid #f5c6c0; color: var(--danger); }
.alert-success { background: #eaf5ec; border: 1px solid #b8dfc1; color: var(--success); }
.alert-warn    { background: #fffbea; border: 1px solid #f0e292; color: #7a6300; }

/* ── Navbar — matches site navbar aesthetic ── */
.navbar {
  background: #fff;
  border-bottom: 1px solid #EEEEEE;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 0 20px rgba(0,0,0,.06);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
/* Logo / back area — no text brand name */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
}
.navbar-brand:hover { color: var(--primary); }
.navbar-brand img   { height: 44px; object-fit: contain; }

.navbar-nav { display: flex; align-items: center; gap: 2px; list-style: none; }
.navbar-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--dark);
  font-size: 15px;
  font-weight: 500;
  transition: all var(--trans);
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--primary); background: var(--primary-lt); }
.navbar-nav a.logout-link { color: var(--danger); }
.navbar-nav a.logout-link:hover { background: #fdecea; color: var(--danger); }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 768px) {
  .navbar-nav a span { display: none; }
  .navbar-brand img  { height: 36px; }
}

/* ── Page Header ── */
.page-header { padding: 36px 0 20px; margin-bottom: 28px; border-bottom: 1px solid #EEEEEE; }
.page-header h1 { font-size: 1.7rem; }
.page-header p  { margin-top: 4px; font-size: 14px; }

/* ── Section ── */
.section { padding: 24px 0 60px; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending    { background: #fff8e1; color: #8a6300; }
.badge-processing { background: #ede7f6; color: #5c3d9e; }
.badge-shipped    { background: #e3f0fd; color: #1565c0; }
.badge-delivered  { background: #e8f5e9; color: #2e7d32; }
.badge-cancelled  { background: #fce4ec; color: #b71c1c; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid #EEEEEE; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--light);
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dark);
  border-bottom: 1px solid #EEEEEE;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid #EEEEEE;
  font-size: 14px;
  color: var(--dark);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 8px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(64,74,61,.48);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .15s ease;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px 16px;
  border-bottom: 1px solid #EEEEEE;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--muted);
  padding: 4px 8px; border-radius: 6px; line-height: 1;
  transition: all var(--trans);
}
.modal-close:hover { background: var(--light); color: var(--dark); }
.modal-body { padding: 22px 26px 26px; }

/* ── Addresses ── */
.address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 18px; }
.address-card {
  background: #fff;
  border: 1px solid #EEEEEE;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans);
}
.address-card:hover { border-color: var(--primary); box-shadow: 0 0 30px rgba(91,140,81,.12); }
.address-card .addr-name  { font-weight: 700; font-size: 15px; color: var(--dark); margin-bottom: 8px; }
.address-card .addr-line  { font-size: 13.5px; color: var(--muted); line-height: 1.75; }
.address-card .addr-actions {
  display: flex; gap: 8px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid #EEEEEE;
}

/* ── Order Detail ── */
.order-detail {
  background: var(--light);
  border: 1px solid #EEEEEE;
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 10px;
}
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .order-detail-grid { grid-template-columns: 1fr; } }
.detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.detail-value { font-size: 14px; color: var(--dark); }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner-dark { border-color: rgba(64,74,61,.15); border-top-color: var(--primary); }

/* ── Page Loader ── */
.page-loader {
  position: fixed; inset: 0;
  background: var(--light); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 18px;
  transition: opacity .3s ease;
}
.page-loader.hidden { opacity: 0; pointer-events: none; }

/* ── Password Strength ── */
.password-strength { height: 4px; border-radius: 2px; background: #EEEEEE; margin-top: 6px; overflow: hidden; }
.strength-bar { height: 100%; border-radius: 2px; transition: width .3s, background .3s; width: 0; }
.strength-text { font-size: 11px; margin-top: 4px; }

/* ── Auth Pages ── */
.auth-page-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(ellipse 65% 50% at 85% 15%, rgba(91,140,81,.08) 0%, transparent 65%),
    radial-gradient(ellipse 50% 55% at 10% 85%, rgba(237,221,94,.06) 0%, transparent 65%),
    var(--bg);
}
.auth-wrap { width: 100%; max-width: 460px; animation: slideUp .35s ease both; }
.auth-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  margin-bottom: 24px; transition: color var(--trans);
}
.auth-back:hover { color: var(--primary); }
.auth-card {
  background: var(--paper);
  border: 1px solid #EEEEEE;
  border-radius: var(--radius-lg);
  padding: 42px 40px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 1.4rem; margin-bottom: 5px; }
.auth-card .subtitle { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
@media (max-width: 480px) { .auth-card { padding: 28px 22px; } }

/* ── Dashboard Profile Header ── */
.profile-header {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 26px; padding: 26px 30px;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.profile-avatar-lg {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; flex-shrink: 0; overflow: hidden;
  box-shadow: 0 4px 16px rgba(91,140,81,.28);
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta h2    { font-size: 1.25rem; margin-bottom: 2px; }
.profile-meta .email{ color: var(--muted); font-size: 13.5px; }
.provider-badge {
  display: inline-block; margin-top: 6px;
  padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--light); color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase;
}

/* ── Stat Cards ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 26px; }
@media (max-width: 680px) { .dashboard-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: #fff; border-radius: var(--radius-lg); padding: 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); text-decoration: none;
  color: inherit; transition: all var(--trans);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
.stat-icon {
  width: 50px; height: 50px; border-radius: var(--radius);
  background: var(--primary-lt); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg  { width: 22px; height: 22px; }
.stat-num       { font-size: 28px; font-weight: 700; color: var(--dark); line-height: 1; }
.stat-label     { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ── Section title row ── */
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }

/* ── Filter bar (Orders) ── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 18px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff; font-family: inherit;
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all var(--trans);
}
.filter-btn.active, .filter-btn:hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-lt);
}

/* ── Order rows ── */
.order-row { cursor: pointer; }
.chevron { display: inline-block; transition: transform .2s ease; font-size: 16px; }
.chevron.open { transform: rotate(90deg); }
.detail-row td { padding: 0 !important; }
.detail-inner  { padding: 18px 18px 22px; }

/* ── Animations ── */
@keyframes fadeIn    { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: translateY(0) } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: translateY(0) } }
@keyframes spin      { to { transform: rotate(360deg) } }
.fade-in { animation: fadeIn .3s ease both; }
