/* ============================================================================
   THE CITRUS SAVER — Shared auth styles
   Matches the established brand (Bungee + Fraunces + Inter, cream/coral/aqua)
   ============================================================================ */

:root {
  --cream: #F4EDD8;
  --cream-soft: #FBF6E5;
  --cream-dark: #E8DCC0;
  --coral: #E2734B;
  --coral-bright: #ED8757;
  --coral-deep: #A84A22;
  --aqua: #6BBDC2;
  --aqua-deep: #2D7984;
  --gold: #E8B948;
  --gold-deep: #C49A2E;
  --moss: #7A8765;
  --ink: #1A1A1A;
  --ink-soft: #2A2A2A;
  --ash: #6B6B5F;
  --line: #D8CDB0;
  --error: #C73E2F;
  --success: #4A7C59;

  --display: 'Bungee', 'Impact', sans-serif;
  --display-shade: 'Bungee Shade', 'Impact', sans-serif;
  --serif: 'Fraunces', 'Georgia', serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle textured background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(var(--ink) 0.5px, transparent 0.5px),
    radial-gradient(var(--coral-deep) 0.4px, transparent 0.4px);
  background-size: 24px 24px, 36px 36px;
  background-position: 0 0, 12px 18px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

/* HEADER */
header {
  background: var(--cream);
  border-bottom: 2px solid var(--ink);
  padding: 18px 0;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.25s;
}
.logo:hover { transform: rotate(-2deg); }
.logo .logo-mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  background: var(--coral);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  position: relative;
  box-shadow: 3px 3px 0 var(--ink);
}
.logo .logo-mark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--cream);
  border-radius: 50%;
}
nav { display: flex; gap: 24px; align-items: center; }
nav a {
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}
nav a:hover { color: var(--coral-deep); }

@media (max-width: 720px) {
  nav { display: none; }
  .logo { font-size: 18px; }
  .logo .logo-mark { width: 30px; height: 30px; }
}

/* AUTH CONTAINER */
.auth-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 50px 28px 80px;
  position: relative;
}

/* Inverness brand strip — subtle banner above auth card */
.auth-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 200px;
  background-image:
    linear-gradient(180deg, transparent 0%, var(--cream) 96%),
    url('/assets/hero-inverness.jpg');
  background-size: cover, cover;
  background-position: center 30%, center 30%;
  background-repeat: no-repeat;
  opacity: 0.85;
  z-index: 0;
  pointer-events: none;
  border-bottom: 2px solid var(--ink);
}
.auth-wrap > * { position: relative; z-index: 1; }

.auth-card {
  background: var(--cream-soft);
  border: 2.5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 40px 36px;
  margin-top: 90px;
}

.auth-card h1 {
  font-family: var(--display);
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.auth-card .subhead {
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  color: var(--ash);
  margin-bottom: 28px;
}

.auth-card .tab-row {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--ink);
}
.auth-card .tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 8px;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--ash);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-card .tab.active {
  color: var(--coral-deep);
  border-bottom-color: var(--coral);
}

/* FORM ELEMENTS */
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"] {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--body);
  font-size: 16px; /* 16px prevents iOS zoom */
  background: var(--cream);
  border: 2px solid var(--ink);
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.15s, transform 0.15s;
}
.field input:focus {
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-1px, -1px);
}
.field .helper {
  font-size: 13px;
  color: var(--ash);
  margin-top: 5px;
  font-style: italic;
}

/* CHECKBOXES (legal stuff) */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 14px;
  padding: 11px 12px;
  background: var(--cream);
  border: 1.5px solid var(--line);
}
.check-row.required {
  border-color: var(--ink);
}
.check-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--coral);
}
.check-row label {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.check-row label a {
  color: var(--coral-deep);
  font-weight: 600;
  text-decoration: underline;
}
.check-row label .req-marker {
  color: var(--coral-deep);
  font-weight: 700;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 15px;
  padding: 14px 26px;
  border: 2.5px solid var(--ink);
  background: var(--coral);
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.6px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--cream);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px dashed var(--ash);
  box-shadow: none;
}
.btn-ghost:hover {
  border-style: solid;
  border-color: var(--ink);
}

/* DIVIDER */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ash);
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--line);
}

/* FOOTER LINKS */
.auth-footer-links {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--ash);
}
.auth-footer-links a {
  color: var(--coral-deep);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-links a:hover { text-decoration: underline; }

/* MESSAGES */
.msg {
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid;
  display: none;
}
.msg.show { display: block; }
.msg.msg-error {
  background: #FBE5E1;
  border-color: var(--error);
  color: var(--error);
}
.msg.msg-success {
  background: #E8F0E8;
  border-color: var(--success);
  color: var(--success);
}
.msg.msg-info {
  background: #E8F2F4;
  border-color: var(--aqua-deep);
  color: var(--aqua-deep);
}

/* SUCCESS STATES */
.center-state {
  text-align: center;
  padding: 30px 10px;
}
.center-state .emoji {
  font-size: 56px;
  margin-bottom: 18px;
  display: block;
}
.center-state h2 {
  font-family: var(--display);
  font-size: 24px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.center-state p {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ash);
  margin-bottom: 22px;
  line-height: 1.55;
}

/* MERCHANT / CONSUMER TOGGLE on signup */
.signup-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--cream);
  border: 2px solid var(--ink);
  padding: 4px;
}
.signup-toggle button {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 8px;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--ash);
  cursor: pointer;
  transition: all 0.15s;
}
.signup-toggle button.active {
  background: var(--coral);
  color: var(--cream);
}

/* MOBILE TUNING */
@media (max-width: 540px) {
  .auth-wrap { padding: 30px 16px 60px; }
  .auth-wrap::before { height: 170px; }
  .auth-card { padding: 28px 22px; box-shadow: 5px 5px 0 var(--ink); margin-top: 95px; }
  .auth-card h1 { font-size: 26px; }
}

/* LOADING SPINNER */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2.5px solid var(--cream);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
