:root {
  --primary: #EA7C26;
  --primary-dark: #B86010;
  --primary-light: #F5EFE6;
  --dark: #18181B;
  --dark-soft: #27272A;
  --muted: #78716C;
  --muted-light: #A8A49E;
  --background: #EDEBE6;
  --section-alt: #E6E3DD;
  --card: #FFFFFF;
  --border: #C8C4BC;
  --border-warm: #D8D4CD;
  --danger-light: #FEF2F2;
  --danger-border: #FCA5A5;
  --danger-text: #991B1B;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --success-border: #86EFAC;
  --surface-dark: #0C0A09;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--dark);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(234,124,38,.16), transparent 46%),
    var(--background);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px 14px;
}

.auth-shell {
  width: min(100%, 440px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface-dark);
  border: 1px solid rgba(255,255,255,.1);
  color: #FAFAF9;
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(12,10,9,.18);
  overflow: hidden;
}

.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-brand-text strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 1.08rem;
  line-height: 1.1;
}

.auth-brand-text span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  margin-top: 2px;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border-warm);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 48px rgba(12,10,9,.09);
}

.auth-heading {
  margin-bottom: 16px;
}

.auth-heading small {
  display: block;
  color: var(--primary-dark);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.auth-heading h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.55rem, 6vw, 2rem);
  line-height: 1.08;
  margin-bottom: 6px;
}

.auth-heading p {
  color: var(--muted);
  font-size: .88rem;
}

.auth-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 16px;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  border: 1px solid var(--border-warm);
  color: var(--primary-dark);
  font-size: .75rem;
  font-weight: 800;
}

.auth-alert {
  border-radius: 13px;
  border: 1px solid var(--danger-border);
  background: var(--danger-light);
  color: var(--danger-text);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: .84rem;
  font-weight: 700;
}

.auth-alert ul {
  display: grid;
  gap: 4px;
  list-style-position: inside;
}

.auth-alert--success {
  border-color: var(--success-border);
  background: var(--success-light);
  color: #166534;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field label {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--section-alt);
  color: var(--dark);
  padding: 11px 13px;
  font-size: .94rem;
  outline: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.auth-field input::placeholder {
  color: var(--muted-light);
}

.auth-field input:focus {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(234,124,38,.12);
}

.auth-note {
  border: 1px solid var(--border-warm);
  border-radius: 13px;
  background: #FFFDF9;
  color: var(--muted);
  padding: 12px 13px;
  font-size: .82rem;
  line-height: 1.55;
}

.auth-note a {
  color: var(--primary-dark);
  font-weight: 800;
}

.auth-note a:hover {
  text-decoration: underline;
}

.auth-inline-link {
  justify-self: end;
  color: var(--primary-dark);
  font-size: .82rem;
  font-weight: 800;
}

.auth-inline-link:hover {
  color: var(--dark);
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 999px;
  background: var(--restaurant-button, var(--primary));
  color: #1C1917;
  font-size: .94rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}

.auth-submit:hover {
  background: var(--primary-dark);
  color: white;
}

.auth-submit:focus-visible,
.auth-link:focus-visible,
.auth-inline-link:focus-visible {
  outline: 3px solid rgba(234,124,38,.28);
  outline-offset: 3px;
}

.auth-submit:active {
  transform: scale(.98);
}

.auth-links {
  display: grid;
  gap: 9px;
  justify-items: center;
  margin-top: 16px;
  text-align: center;
}

.auth-link {
  color: var(--primary-dark);
  font-size: .87rem;
  font-weight: 800;
}

.auth-link:hover {
  color: var(--dark);
}

.auth-link--muted {
  color: var(--muted);
  font-weight: 700;
}

@media (min-width: 720px) {
  .auth-page {
    padding: 34px 20px;
  }

  .auth-card {
    padding: 24px;
  }
}

@media (max-width: 380px) {
  .auth-card {
    padding: 17px;
  }

  .auth-brand-mark {
    width: 38px;
    height: 38px;
  }
}

/* Customer profile */

body.customer-profile-page {
  min-height: 100vh;
  display: block;
  background: var(--background);
  color: var(--dark);
  padding-bottom: 64px;
}

.profile-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.profile-topbar {
  height: 52px;
  padding: 0 16px;
  background: var(--surface-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
}

.profile-topbar-brand,
.profile-topbar-back {
  display: inline-flex;
  align-items: center;
}

.profile-topbar-brand {
  min-width: 0;
  gap: 10px;
}

.profile-topbar-mark {
  width: 32px;
  height: 32px;
  overflow: hidden;
  background: var(--primary);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: white;
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.profile-topbar-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-topbar-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.profile-topbar-back {
  gap: 5px;
  color: rgba(255,255,255,.62);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: color .15s ease;
}

.profile-topbar-back:hover {
  color: white;
}

.profile-hero-card {
  position: relative;
  overflow: hidden;
  background: var(--surface-dark);
  border-radius: 20px;
  padding: 28px 24px;
  margin-bottom: 16px;
}

.profile-hero-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(234,124,38,.18) 0%, transparent 70%);
  pointer-events: none;
}

.profile-hero-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.profile-hero-avatar {
  width: 52px;
  height: 52px;
  background: rgba(234,124,38,.15);
  border: 1.5px solid rgba(234,124,38,.3);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.profile-hero-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(234,124,38,.25);
  border-radius: 999px;
  background: rgba(234,124,38,.12);
  color: var(--primary);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

.profile-hero-name,
.profile-hero-sub,
.profile-stats {
  position: relative;
}

.profile-hero-name {
  color: white;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.5px;
  margin-bottom: 4px;
}

.profile-hero-sub {
  color: rgba(255,255,255,.45);
  font-size: .84rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.profile-stat {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
}

.profile-stat strong {
  display: block;
  color: white;
  font-family: 'Fraunces', serif;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 5px;
}

.profile-stat span {
  color: rgba(255,255,255,.45);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--border-warm);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 14px;
}

.profile-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-warm);
}

.profile-card-label::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--primary);
  border-radius: 999px;
  flex: 0 0 auto;
}

.profile-card-label-text {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.profile-reward-card {
  background: var(--success-light);
  border: 1.5px solid var(--success-border);
  border-radius: 16px;
  padding: 20px;
}

.profile-reward-pill {
  display: inline-flex;
  align-items: center;
  background: var(--success);
  color: white;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.profile-reward-card h2 {
  color: #14532D;
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  line-height: 1.15;
  margin-bottom: 6px;
}

.profile-reward-card p {
  color: #166534;
  font-size: .88rem;
  line-height: 1.58;
  margin-top: 8px;
}

.profile-reward-description {
  font-size: 1rem !important;
  font-weight: 800;
}

.profile-loyalty-box {
  background: #FFFDF9;
  border: 1.5px solid rgba(184,96,16,.18);
  border-radius: 16px;
  padding: 20px;
}

.profile-loyalty-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--dark);
  font-size: .88rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.profile-loyalty-count {
  color: var(--primary-dark);
  white-space: nowrap;
}

.profile-progress-track {
  height: 10px;
  background: var(--section-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.profile-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.profile-loyalty-note {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.55;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.profile-logout-form {
  display: contents;
}

.profile-btn {
  min-height: 42px;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: .9rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}

.profile-btn-primary {
  background: var(--restaurant-button, var(--primary));
  color: #1C1917;
}

.profile-btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

.profile-btn-ghost {
  background: var(--section-alt);
  color: var(--dark);
}

.profile-btn-ghost:hover {
  background: var(--border-warm);
}

.profile-btn:active {
  transform: scale(.98);
}

.profile-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.profile-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-warm);
}

.profile-table td {
  color: var(--dark);
  font-size: .88rem;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-warm);
  vertical-align: middle;
}

.profile-table tr:last-child td {
  border-bottom: none;
}

.profile-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.profile-status.status-success {
  background: var(--success-light);
  color: #166534;
}

.profile-status.status-warning {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.profile-status.status-danger {
  background: var(--danger-light);
  color: var(--danger-text);
}

.profile-total {
  color: var(--primary-dark) !important;
  font-weight: 800;
  white-space: nowrap;
}

.profile-date {
  color: var(--muted) !important;
  font-size: .84rem !important;
  white-space: nowrap;
}

.profile-empty {
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  background: #FFFDF9;
  padding: 20px;
  text-align: center;
  font-size: .9rem;
  font-weight: 600;
}

@media (max-width: 520px) {
  .profile-topbar {
    margin-bottom: 18px;
  }

  .profile-container {
    padding: 0 12px;
  }

  .profile-hero-card,
  .profile-card {
    border-radius: 16px;
    padding: 20px 16px;
  }

  .profile-stats {
    gap: 8px;
  }

  .profile-stat {
    padding: 13px 8px;
  }

  .profile-stat strong {
    font-size: 1.55rem;
  }

  .profile-actions,
  .profile-btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .profile-topbar-back {
    font-size: 0;
    gap: 0;
  }

  .profile-topbar-back svg {
    width: 18px;
    height: 18px;
  }

  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }

  .profile-stat:last-child {
    grid-column: 1 / -1;
  }
}
