/* ============================================================================
   Harrow Bowls Club — Members app styles
   The brand palette lives in brand-tokens.css (imported below). These styles
   are lifted from members-app-mockup.html so the built app matches the visual
   target, with the wireframe presentation chrome (rail / stage / device frame)
   stripped out: the app *is* the device now, rendered responsively.
   ============================================================================ */

@import url("brand-tokens.css");

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Lora', Georgia, serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(201, 169, 97, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 169, 97, 0.04) 0%, transparent 50%);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* The app column. On a phone it fills the screen; on a wide screen it sits as a
   centred "device" against the Oxford-blue page, echoing the mockup. */
.app {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
}
@media (min-width: 480px) {
  body { padding: 24px 0; align-items: flex-start; }
  .app {
    min-height: auto;
    height: calc(100vh - 48px);
    border: 1px solid var(--gold);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(0, 21, 48, 0.45);
  }
}

/* paper grain, as in the mockup */
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.app > * { position: relative; z-index: 1; }

/* ─── header ─────────────────────────────────────────────── */
.m-header {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.m-header-eyebrow {
  font-size: 11px; letter-spacing: 0.14em; color: var(--ink-faint);
  text-transform: uppercase; font-weight: 600;
}
.m-header-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em;
}
.m-header-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--ink-soft); cursor: pointer;
  background: transparent;
}

/* ─── top tabs (Today / Week / Month etc.) ─────────────────── */
.m-tabs { display: flex; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.m-tab {
  flex: 1; padding: 11px; text-align: center;
  font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 2px solid transparent; cursor: pointer; font-weight: 600;
  background: transparent;
}
.m-tab.active { color: var(--ink); border-bottom-color: var(--gold); }

/* ─── scrolling content region ─────────────────────────────── */
.m-content { flex: 1; overflow-y: auto; padding: 14px 16px 84px; }

/* ─── bottom tab bar ───────────────────────────────────────── */
.m-bottomnav {
  position: absolute; bottom: 0; left: 0; right: 0; height: 62px;
  background: var(--paper); border-top: 1px solid var(--gold);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.m-navitem {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px;
  font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 0.16em;
  color: var(--ink-faint); cursor: pointer; font-weight: 600;
  background: transparent; border: none;
}
.m-navitem.active { color: var(--ink); }
.m-navitem .icn { width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 4px; }
.m-navitem.active .icn { background: rgba(201, 169, 97, 0.18); }

/* ─── floating "Book a rink" action ────────────────────────── */
.m-fab {
  position: absolute; right: 16px; bottom: 76px;
  background: var(--ink); color: var(--gold-soft); border-radius: 24px;
  padding: 11px 17px 11px 15px;
  font-family: 'Cinzel', serif; font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 21, 48, 0.32);
  border: 1px solid var(--gold); cursor: pointer;
}
.m-fab::before { content: "＋"; font-size: 14px; color: var(--gold-soft); }

/* ─── common primitives ────────────────────────────────────── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.card + .card { margin-top: 10px; }
.h-section {
  font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold-deep); margin: 18px 0 10px; font-weight: 600;
}
.h-section:first-child { margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-family: 'Cinzel', serif; font-size: 11px; font-weight: 600; border-radius: 4px;
  cursor: pointer; letter-spacing: 0.18em; text-transform: uppercase; transition: all 0.2s;
}
.btn:hover { background: var(--accent-soft); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-mid); border-color: var(--ink-mid); }
.btn-block { display: flex; width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 600; color: var(--ink-soft);
}
.pill-warn { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.pill-ok { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 12px 14px;
  font-size: 14px; font-family: 'Lora', serif; color: var(--ink); background: var(--paper);
}
.input::placeholder { color: var(--ink-ghost); font-style: italic; font-family: 'Cormorant Garamond', serif; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15); }

/* ─── calendar entry list / today banner (mockup screen 02) ──── */
.today-banner {
  background: linear-gradient(135deg, var(--paper-warm) 0%, var(--paper-soft) 100%);
  border: 1px solid var(--gold); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; position: relative;
}
.today-banner::before {
  content: ""; position: absolute; inset: 4px; border: 1px solid var(--gold);
  border-radius: 5px; opacity: 0.3; pointer-events: none;
}
.today-banner-day {
  font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--maroon); margin-bottom: 4px; font-weight: 600;
}
.today-banner-date {
  font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 500; margin-bottom: 8px;
  color: var(--ink); letter-spacing: -0.005em;
}
.today-banner-meta {
  font-family: 'Lora', serif; font-size: 12px; color: var(--ink-soft);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.today-banner-meta strong {
  color: var(--ink); font-style: italic; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 13px;
}

.entry { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: none; padding-top: 4px; }
.entry-time {
  width: 54px; flex-shrink: 0; font-family: 'Cinzel', serif; font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--ink); font-weight: 600; letter-spacing: 0.04em;
}
.entry-time-secondary { font-size: 10px; color: var(--ink-faint); margin-top: 3px; font-weight: 400; letter-spacing: 0; }
.entry-body { flex: 1; min-width: 0; }
.entry-title {
  font-family: 'Cormorant Garamond', serif; font-size: 16px; font-weight: 500;
  margin-bottom: 3px; color: var(--ink); line-height: 1.3;
}
.entry-meta {
  font-family: 'Lora', serif; font-size: 12px; color: var(--ink-soft);
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; line-height: 1.5;
}
.rink-tag {
  display: inline-flex; align-items: center; gap: 5px; font-family: 'Cinzel', serif;
  font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft);
}
.rink-tag::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--rk-color, #ccc); border: 1px solid var(--line-strong);
}
.rink-red { --rk-color: #C53D3D; }
.rink-blue { --rk-color: #2A5599; }
.rink-white { --rk-color: #FBF8F1; }

/* ─── empty / coming-soon state (Phase 1 placeholders) ──────── */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px; color: var(--ink-faint); gap: 10px; min-height: 60%;
}
.empty-mark {
  width: 54px; height: 54px; border: 1.5px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; color: var(--gold-deep); font-size: 22px;
}
.empty-title {
  font-family: 'Cormorant Garamond', serif; font-size: 20px; color: var(--ink); font-weight: 500;
}
.empty-sub { font-family: 'Lora', serif; font-size: 13px; color: var(--ink-soft); max-width: 260px; line-height: 1.6; }
.empty-phase {
  font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-deep); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
}

/* ─── sign-in screen (mockup screen 01) ────────────────────── */
.login-frame {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 32px;
}
.login-mark {
  width: 200px; margin-bottom: 32px; background-image: url("crest.png");
  background-size: contain; background-repeat: no-repeat; background-position: center;
  aspect-ratio: 1170/780; filter: drop-shadow(0 4px 12px rgba(0, 33, 71, 0.18));
}
.login-eyebrow {
  font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--maroon); font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 14px;
}
.login-eyebrow::before, .login-eyebrow::after {
  content: ""; width: 24px; height: 1px; background: var(--maroon); opacity: 0.5; display: inline-block;
}
.login-title {
  font-family: 'Cormorant Garamond', serif; font-size: 32px; margin-bottom: 12px; font-weight: 500;
  text-align: center; color: var(--ink); line-height: 1.1; letter-spacing: -0.005em;
}
.login-title em { font-style: italic; color: var(--gold); }
.login-sub {
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 16px; color: var(--ink-soft);
  text-align: center; margin-bottom: 32px; line-height: 1.5; max-width: 280px;
}
.login-form { width: 100%; max-width: 320px; }
.login-form .input { margin-bottom: 14px; }
.login-foot { margin-top: 32px; font-family: 'Lora', serif; font-size: 12px; color: var(--ink-faint); text-align: center; line-height: 1.7; }
.login-foot a { color: var(--maroon); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; cursor: pointer; }
.login-note {
  margin-top: 18px; font-family: 'Lora', serif; font-size: 12.5px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 12px 14px; text-align: center; line-height: 1.5; max-width: 320px;
}

/* ─── calendar: prev/next nav (screens 02–03) ──────────────── */
.cal-root { min-height: 40%; }
.cal-loading, .cal-empty {
  text-align: center; color: var(--ink-faint); font-family: 'Lora', serif;
  font-size: 13px; line-height: 1.6; padding: 28px 16px;
}
.cal-empty { border: 1px dashed var(--line); border-radius: 8px; margin-top: 6px; }
.cal-empty strong { color: var(--gold-deep); font-style: italic; font-family: 'Cormorant Garamond', serif; }

.cal-nav {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.cal-nav-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 8px; background: transparent;
  color: var(--ink-soft); font-size: 18px; line-height: 1; cursor: pointer;
}
.cal-nav-btn:hover { background: var(--accent-soft); }
.cal-nav-label { flex: 1; text-align: center; min-width: 0; }
.cal-nav-eyebrow {
  display: block; font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold-deep); font-weight: 600;
}
.cal-nav-main {
  display: block; font-family: 'Cormorant Garamond', serif; font-size: 17px;
  color: var(--ink); font-weight: 500;
}
.cal-nav-today {
  flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 600; padding: 6px 11px;
}

/* ─── week view ────────────────────────────────────────────── */
.wk-day { border-top: 1px solid var(--line); padding: 10px 0; display: flex; gap: 12px; }
.wk-day:first-of-type { border-top: none; }
.wk-day-head { width: 48px; flex-shrink: 0; text-align: center; }
.wk-day-name {
  display: block; font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 600;
}
.wk-day-num {
  display: block; font-family: 'Cormorant Garamond', serif; font-size: 22px;
  color: var(--ink); font-weight: 500; line-height: 1.1;
}
.wk-today .wk-day-num { color: var(--maroon); }
.wk-today-pill {
  display: inline-block; font-family: 'Cinzel', serif; font-size: 7.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--paper); background: var(--maroon);
  border-radius: 999px; padding: 1px 6px; margin-top: 2px; font-weight: 600;
}
.wk-day-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.wk-entry { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.wk-entry-time {
  font-family: 'Cinzel', serif; font-variant-numeric: tabular-nums; font-size: 11px;
  color: var(--ink-faint); width: 40px; flex-shrink: 0;
}
.wk-entry-title { font-family: 'Cormorant Garamond', serif; font-size: 15px; color: var(--ink); flex: 1; min-width: 0; }
.wk-entry-fmt { font-family: 'Lora', serif; font-size: 11px; color: var(--ink-soft); flex-shrink: 0; }
.wk-entry-none { color: var(--ink-ghost); }
.wk-entry-you .wk-entry-title { color: var(--maroon); font-style: italic; }

/* ─── month grid ───────────────────────────────────────────── */
.mo-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mo-head { margin-bottom: 4px; }
.mo-dow {
  text-align: center; font-family: 'Cinzel', serif; font-size: 8.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 600; padding: 2px 0;
}
.mo-cell {
  aspect-ratio: 1 / 1; border: 1px solid transparent; border-radius: 7px; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; padding: 0;
}
.mo-cell:hover { background: var(--paper-soft); }
.mo-num { font-family: 'Cormorant Garamond', serif; font-size: 15px; color: var(--ink); font-weight: 500; line-height: 1; }
.mo-out { opacity: 0.32; cursor: default; }
.mo-out:hover { background: transparent; }
.mo-today { background: var(--accent-soft); }
.mo-today .mo-num { color: var(--maroon); font-weight: 600; }
.mo-sel { border-color: var(--gold); }
.mo-dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.mo-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.mo-match { background: var(--maroon); }
.mo-event { background: var(--gold); }
.mo-deadline { background: var(--accent); }

.mo-foot { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.mo-foot-sel {
  font-family: 'Cormorant Garamond', serif; font-size: 15px; color: var(--ink);
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 10px;
}
.mo-legend { display: flex; gap: 16px; }
.mo-legend span {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Lora', serif; font-size: 12px; color: var(--ink-soft);
}

.hidden { display: none !important; }
