/* ============================================================================
   Buy Me a Photo — shared design system
   ----------------------------------------------------------------------------
   Single source of truth for the online pages: /dashboard, /register and the
   public photographer profile (rendered by src/routes/gallery.js). The tokens
   mirror landing.html so the whole site reads as one product.

   Pages must load Inter themselves (a <link> in <head> parallelises better
   than an @import here):
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">

   NOTE: served from the site root. Safe despite the /:pid catch-all in
   gallery.js, which lets any path with a file extension fall through to
   express.static.
   ========================================================================= */

:root {
  /* ─── Surfaces ─────────────────────────────────────────────────────────── */
  --bg: #0B1220;
  --bg-2: #0f1730;
  --bg-3: #141d3a;
  --bg-4: #1a2547;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .15);

  /* ─── Text ─────────────────────────────────────────────────────────────── */
  --text: #e9eefc;
  --text-2: #aab4d4;
  --text-3: #6c7799;

  /* ─── Brand ────────────────────────────────────────────────────────────── */
  --amber: #FFC107;
  --amber-2: #FF9800;
  /* Components paint with --accent so the public profile page can swap in the
     photographer's own colour without touching any component rule. */
  --accent: var(--amber);
  --accent-2: var(--amber-2);
  --accent-ink: #16100a;
  --accent-soft: rgba(255, 193, 7, .12);

  /* ─── Status ───────────────────────────────────────────────────────────── */
  --green: #22c55e;
  --blue: #3b82f6;
  --warn: #f59e0b;
  --red: #ef4444;

  /* ─── Radii ────────────────────────────────────────────────────────────── */
  --r-sm: 10px;
  --r: 14px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* ─── Elevation: layered and low-opacity, never a single hard shadow ───── */
  --shadow-sm: 0 1px 2px rgba(3, 7, 18, .40), 0 2px 8px -3px rgba(3, 7, 18, .35);
  --shadow-md: 0 4px 12px -3px rgba(3, 7, 18, .45), 0 14px 32px -14px rgba(3, 7, 18, .55);
  --shadow-lg: 0 10px 28px -8px rgba(3, 7, 18, .55), 0 28px 64px -22px rgba(3, 7, 18, .65);
  --shadow-glow: 0 24px 80px -20px rgba(255, 193, 7, .25);

  --container: 1180px;

  /* ─── Legacy aliases ───────────────────────────────────────────────────── */
  /* dashboard.html and a few JS-generated inline styles still reference these
     names; keeping them mapped means no rule silently loses its colour. */
  --ink: var(--text);
  --muted: var(--text-2);
  --panel: var(--bg-2);
  --card: var(--bg-3);
  --accent2: var(--amber-2);
  --success: var(--green);
  --danger: var(--red);
  --radius: var(--r-md);
  --radius-lg: var(--r-lg);
}

/* ─── Base ─────────────────────────────────────────────────────────────────── */

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

/* Component classes below set `display`, which would otherwise beat the UA
   rule for [hidden] and leave "hidden" elements on screen. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
table { border-collapse: collapse; }

/* Money and counters must not jitter as they update. */
.tnum, .money, table, input[type="number"] { font-variant-numeric: tabular-nums; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.divider { height: 1px; background: var(--line); border: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── Typography ───────────────────────────────────────────────────────────── */

.page-title { font-size: 25px; font-weight: 900; letter-spacing: -.7px; }
.section-title { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; color: var(--text-3);
}
.muted-text { color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.brand-gradient {
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── Logo mark ────────────────────────────────────────────────────────────── */

.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 900; font-size: 16px; flex-shrink: 0;
  box-shadow: 0 8px 24px -8px rgba(255, 193, 7, .6);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700; line-height: 1;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled { opacity: .5; cursor: default; transform: none !important; box-shadow: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 6px 18px -8px rgba(255, 193, 7, .55);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px rgba(255, 193, 7, .6);
}

.btn-ghost { background: rgba(255, 255, 255, .04); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, .07); border-color: var(--line-strong); color: var(--text);
}

.btn-danger { background: rgba(239, 68, 68, .12); color: var(--red); border-color: rgba(239, 68, 68, .3); }
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, .2); }

.btn-stripe { background: #635BFF; color: #fff; box-shadow: 0 8px 22px -10px rgba(99, 91, 255, .8); }
.btn-stripe:hover:not(:disabled) { transform: translateY(-1px); background: #5348ff; }

.btn-block { width: 100%; }
.btn-pill { border-radius: var(--r-pill); }
.btn-sm { padding: 8px 15px; font-size: 13px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* ─── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 20px 24px 14px;
}
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 800; letter-spacing: -.25px; }
.card-head p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-top: 4px; }
.card-sep { height: 1px; background: var(--line); }

/* A soft accent bloom in a card corner; the element needs position:relative
   and overflow:hidden. */
.card-bloom { position: relative; overflow: hidden; }
.card-bloom::before {
  content: ''; position: absolute; top: -90px; right: -90px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.card-bloom > * { position: relative; z-index: 1; }

/* ─── Chips (filters, period pickers) ──────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  color: var(--text-2); font-size: 12.5px; font-weight: 600;
  transition: color .15s, background .15s, border-color .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: var(--accent-ink);
}
.chip svg { width: 13px; height: 13px; }
.chip .count {
  background: rgba(0, 0, 0, .18); padding: 1px 7px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 800;
}
.chip:not(.active) .count { background: rgba(255, 255, 255, .07); color: var(--text-2); }

/* ─── Badges ───────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block; font-size: 10px; font-weight: 800;
  letter-spacing: .4px; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px; white-space: nowrap;
}
.badge-paid { background: rgba(34, 197, 94, .12); color: var(--green); }
.badge-pending { background: rgba(245, 158, 11, .12); color: var(--warn); }
.badge-transit { background: rgba(59, 130, 246, .12); color: var(--blue); }
.badge-failed { background: rgba(239, 68, 68, .12); color: var(--red); }
.badge-muted { background: rgba(148, 163, 184, .12); color: var(--text-2); }

/* ─── Form fields ──────────────────────────────────────────────────────────── */

.field { margin-bottom: 16px; }
.field > label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 7px;
}
.field input, .field textarea, .field select, .input {
  width: 100%; background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text); padding: 12px 14px; font-size: 14.5px;
  font-family: inherit; outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus {
  border-color: var(--accent); background: rgba(255, 255, 255, .05);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.field .err-text { font-size: 12.5px; color: var(--red); margin-top: 6px; }

/* Native select with a custom chevron. */
.select {
  appearance: none; -webkit-appearance: none;
  background-color: rgba(255, 255, 255, .03);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab4d4' stroke-width='2.5' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--text); padding: 8px 34px 8px 15px;
  font-size: 13px; font-weight: 600; outline: none;
  transition: border-color .15s;
}
.select:hover, .select:focus { border-color: var(--accent); }

/* ─── Avatar ───────────────────────────────────────────────────────────────── */

.avatar {
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; text-transform: uppercase;
  background: linear-gradient(135deg, #6366f1, #a855f7);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Empty states ─────────────────────────────────────────────────────────── */

.empty {
  text-align: center; padding: 46px 24px;
  color: var(--text-2); font-size: 14px; line-height: 1.65;
}
.empty strong { color: var(--text); font-weight: 700; }
.empty .empty-ic {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  color: var(--text-3);
}
.empty .empty-ic svg { width: 24px; height: 24px; }
.empty .empty-title { color: var(--text); font-size: 15px; font-weight: 700; margin-bottom: 6px; }

/* ─── Skeleton loaders ─────────────────────────────────────────────────────── */

.skeleton {
  position: relative; overflow: hidden;
  background: rgba(255, 255, 255, .045); border-radius: 8px;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
  animation: sk-sweep 1.4s infinite;
}
@keyframes sk-sweep { 100% { transform: translateX(100%); } }

.sk-line { height: 12px; }
.sk-line + .sk-line { margin-top: 9px; }
.sk-title { height: 20px; width: 42%; }
.sk-amount { height: 42px; width: 55%; border-radius: 12px; }
.sk-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.sk-w-25 { width: 25%; } .sk-w-40 { width: 40%; }
.sk-w-60 { width: 60%; } .sk-w-80 { width: 80%; }
.sk-row { display: flex; align-items: center; gap: 14px; padding: 15px 22px; border-bottom: 1px solid var(--line); }
.sk-row:last-child { border-bottom: none; }
.sk-row .sk-grow { flex: 1; min-width: 0; }

/* ─── Toasts ───────────────────────────────────────────────────────────────── */

.toast-host {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 12000; width: 100%; max-width: 540px; padding: 0 16px;
  display: flex; flex-direction: column-reverse; align-items: center; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 100%;
  background: var(--bg-3); border: 1px solid var(--line-strong);
  color: var(--text); box-shadow: var(--shadow-lg);
  padding: 12px 20px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; line-height: 1.4;
  opacity: 0; transform: translateY(12px) scale(.96);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: none; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-ok svg { color: var(--green); }
.toast-err svg { color: var(--red); }

@media (max-width: 640px) {
  .toast-host { bottom: 84px; }
}

/* ─── Modal overlay ────────────────────────────────────────────────────────── */

.overlay {
  display: none; position: fixed; inset: 0; z-index: 10000;
  background: rgba(3, 7, 18, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 400px; padding: 28px 24px; position: relative;
  animation: modal-in .22s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 20px; line-height: 1;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: rgba(255, 255, 255, .06); color: var(--text); }

/* ─── Tables ───────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; }
.table th {
  text-align: left; padding: 11px 22px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-3);
}
.table td { padding: 13px 22px; font-size: 13.5px; border-top: 1px solid var(--line); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }

/* ─── Sticky blurred top bar (matches the landing page header) ─────────────── */

.appbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 18, 32, .72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.appbar.scrolled { border-bottom-color: var(--line); }

/* ─── Accessibility ────────────────────────────────────────────────────────── */

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Scrollbars ───────────────────────────────────────────────────────────── */

* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .13); border-radius: var(--r-pill);
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); background-clip: content-box; }
