/* Light is the base palette. Dark applies on a dark device (unless the viewer forced light)
   and on an explicit dark choice. */
:root {
  --bg: #faf7fb; --card: #ffffff; --ink: #1a141f; --dim: #6b6472; --line: #e7e2ec;
  --accent: #ff5c7a; --accent2: #8b5cf6; --ok: #1e7f4d; --warn: #8a6d1a; --shadow: 0 10px 40px #1a141f14;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #15111b; --card: #1c1b21; --ink: #f6f1ef; --dim: #b3a7bd; --line: #2e2c36; --shadow: 0 10px 40px #0006; }
}
:root[data-theme="dark"] { --bg: #15111b; --card: #1c1b21; --ink: #f6f1ef; --dim: #b3a7bd; --line: #2e2c36; --shadow: 0 10px 40px #0006; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 -apple-system, system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 22px; }

.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { font-weight: 800; letter-spacing: 0.02em; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.brand .dot { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
/* "Work in progress" caution-tape badge for the temporary name. */
.brand-temp {
  position: relative;
  display: inline-block;
  margin-left: 9px;
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a1206;
  background: #f7c948;
  border-radius: 3px;
  transform: rotate(-3deg);
  box-shadow: 0 2px 5px #0000004d;
  white-space: nowrap;
  vertical-align: middle;
}
/* hazard-stripe strips along the top and bottom edges, like tape */
.brand-temp::before, .brand-temp::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: repeating-linear-gradient(45deg, #1a1206 0 5px, #f7c948 5px 10px);
}
.brand-temp::before { top: 0; }
.brand-temp::after { bottom: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* Landing hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding: 40px 0 60px; }
.hero h1 { font-size: 44px; line-height: 1.05; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 18px; color: var(--dim); margin: 0 0 24px; max-width: 46ch; }
.hero .points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hero .points li { display: flex; gap: 10px; }
.hero .points li::before {
  content: ''; flex: none; width: 1.15em; height: 1.15em; margin-top: 1px; background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5 11-11'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5 11-11'/%3E%3C/svg%3E") center/contain no-repeat;
}
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 34px; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.auth h2 { margin: 0 0 4px; font-size: 20px; }
.auth .sub { color: var(--dim); margin: 0 0 18px; font-size: 14px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--dim); }
.field input { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--ink); font-size: 15px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.socials { display: grid; gap: 8px; margin-bottom: 16px; }
.social { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; font: inherit; transition: background .12s ease, box-shadow .12s ease; }
.social-ico { width: 18px; height: 18px; flex: none; }
.social .soon { color: var(--dim); font-size: 12px; font-weight: 500; }

/* Official brand colors per provider */
.social[data-provider="google"] { background: #fff; color: #3c4043; border-color: #dadce0; }
.social[data-provider="google"]:hover { background: #f7f8f8; box-shadow: 0 1px 2px rgba(60,64,67,.18); }
.social[data-provider="facebook"] { background: #1877f2; color: #fff; border-color: #1877f2; }
.social[data-provider="facebook"]:hover { background: #166fe5; }
.social[data-provider="apple"] { background: #000; color: #fff; border-color: #000; }
.social[data-provider="apple"]:hover { background: #1a1a1a; }
.social[data-provider="facebook"] .soon,
.social[data-provider="apple"] .soon { color: rgba(255,255,255,.75); }
/* The hidden attribute must win over the display:flex above (higher specificity). */
.social[hidden] { display: none !important; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; margin: 6px 0 16px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.err { color: var(--accent); font-size: 13px; min-height: 18px; margin: 2px 0 8px; }
.toggle { text-align: center; color: var(--dim); font-size: 14px; margin-top: 14px; }
.toggle button { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }

/* Dashboard */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; font-size: 26px; }
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.session { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.session h3 { margin: 0; font-size: 17px; }
.session .meta { color: var(--dim); font-size: 13px; }
.badge { align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.active { background: #1e7f4d22; color: var(--ok); }
.badge.pending_payment { background: #8a6d1a22; color: var(--warn); }
.badge.cancelled, .badge.expired, .badge.exhausted { background: #a3283a22; color: var(--accent); }
.session .row { margin-top: auto; display: flex; gap: 8px; }
.empty { text-align: center; color: var(--dim); padding: 50px 20px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); }

/* In-app modal (replaces the browser's native prompt) */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: #0b0810b3; backdrop-filter: blur(2px); }
.modal { width: 100%; max-width: 380px; }
.modal h2 { margin: 0 0 14px; font-size: 20px; }
.modal-input { width: 100%; box-sizing: border-box; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; }
.modal-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.hidden { display: none !important; }

/* Light/dark theme toggle button. */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  cursor: pointer; padding: 0; vertical-align: middle;
}
.theme-toggle:hover { border-color: var(--dim); }

/* Inline SVG icons size to the surrounding text (guards against an unsized icon blowing up). */
.icon { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; }
