/* PartnersHub — AREP brand layer, ported from joinashworthpartners.com so the
   portal and the marketing site feel like ONE brand.
   Pure-black canvas, metallic-silver display headings, royal-blue accents.
   AREP colours ONLY — no green/amber traffic-light; status uses blue / silver /
   a single muted red. */

:root {
  --black: #000000;
  --blue: #0A5BD0;
  --blue-deep: #0556BC;
  --blue-bright: #2E7BE8;
  --silver-50: #F2F4F6;
  --silver-100: #D7DBE0;
  --silver-200: #AEB2B8;
  --silver-300: #82868C;
  --silver-400: #888C93;
  --body: #9CA0A6;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --red-muted: #E0526A;   /* the ONLY non-AREP hue: true failure/error, used sparingly */
  --red-text: #F2849A;
}

html, body { background: #000; }
body { color: var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* ---- Typography ------------------------------------------------------- */
.font-display, .metallic, .metallic-blue { font-family: "Cormorant Garamond", Georgia, serif; }

.label-accent {
  font-family: Inter, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Metallic silver gradient on big display headings. padding-bottom is REQUIRED
   (not cosmetic): background-clip:text only paints inside the box, and tight
   serif headings clip descenders without it. Keep on the shared class. */
.metallic {
  background: linear-gradient(177deg, #FFFFFF 0%, #E6E9ED 22%, #C7CBD1 46%, #9CA0A6 66%, #6B7077 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  padding-bottom: 0.2em;
}
.metallic-blue {
  background: linear-gradient(177deg, #EAF1FF 0%, #B9D2FB 40%, #6FA2F0 70%, #2E7BE8 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  padding-bottom: 0.2em;
}

/* ---- Buttons ---------------------------------------------------------- */
/* Primary = the marketing royal-blue gradient pill (the brand CTA). */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
       font-weight: 600; cursor: pointer; border-radius: 9999px; border: 1px solid transparent;
       transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.2s ease,
                   color 0.2s ease, background 0.2s ease, border-color 0.2s ease; }
.btn-primary {
  color: #fff; padding: 0.7rem 1.4rem; font-size: 0.9rem;
  background: linear-gradient(180deg, var(--blue-bright) 0%, var(--blue) 55%, var(--blue-deep) 100%);
  box-shadow: 0 0 0 1px rgba(46, 123, 232, 0.4), 0 8px 30px -10px rgba(46, 123, 232, 0.55);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.07);
  box-shadow: 0 0 0 1px rgba(46, 123, 232, 0.6), 0 14px 40px -8px rgba(46, 123, 232, 0.7); }
.btn-primary:active { transform: translateY(0); }
/* Ghost = subtle outline pill secondary (adapted from the marketing text-ghost so
   it reads as a real button in the portal). */
.btn-ghost {
  color: var(--silver-100); padding: 0.65rem 1.3rem; font-size: 0.9rem; font-weight: 500;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line-strong);
}
.btn-ghost:hover { color: var(--silver-50); border-color: var(--blue-bright); background: rgba(255,255,255,0.06); }
/* Danger = the single muted red, used only for destructive actions. */
.btn-danger {
  color: var(--red-text); padding: 0.65rem 1.3rem; font-size: 0.9rem; font-weight: 600;
  background: rgba(224,82,106,0.10); border: 1px solid rgba(224,82,106,0.4);
}
.btn-danger:hover { background: rgba(224,82,106,0.18); border-color: rgba(224,82,106,0.6); }
.btn-sm, .btn.text-sm, .btn.text-xs { padding: 0.5rem 1.05rem; }

/* ---- Cards & surfaces ------------------------------------------------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  border: 1px solid var(--line); border-radius: 16px;
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}
.card-hover:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.hairline { border-color: var(--line); }

/* Section eyebrow rule */
.eyebrow-rule::before { content: ""; display: inline-block; width: 28px; height: 1px;
  background: var(--blue-bright); vertical-align: middle; margin-right: 0.8rem; }

/* Ambient blue glow blobs (hero) */
.glow { position: absolute; border-radius: 9999px; filter: blur(90px); opacity: 0.5; pointer-events: none; }

/* ---- Status pills ----------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem;
        border-radius: 9999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; }

/* ---- Checklist/tasklist checkbox control (M5) --------------------------
   The old ad-hoc `bg-black` unchecked box was nearly invisible against the pure-black
   card background (no border). A visible border + a faint fill fixes contrast in the
   unchecked state; the checked state fills solid brand-blue (this app's "done" hue). */
.checkbox-control {
  height: 1.25rem; width: 1.25rem; min-width: 1.25rem; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700;
  border: 1.5px solid var(--silver-300); background: rgba(255,255,255,0.05); color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.checkbox-control:hover:not(:disabled) { border-color: var(--blue-bright); background: rgba(46,123,232,0.10); }
.checkbox-control.is-done { background: var(--blue-bright); border-color: var(--blue-bright); color: #000; }
.checkbox-control:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Forms (bare elements — the portal uses raw input/select/textarea) - */
label { font-weight: 500; }
input, select, textarea {
  width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--line-strong);
  border-radius: 10px; color: #EDEFF2; padding: 0.7rem 0.85rem; font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder, textarea::placeholder { color: #82868C; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue-bright); background: rgba(46,123,232,0.06);
  box-shadow: 0 0 0 3px rgba(46,123,232,0.15);
}
/* Checkboxes/radios are NOT text fields: undo the full-width padded-box rule
   above (it stretched the SMS-consent checkbox + plan-picker radios into
   full-row bars). Fixed square, brand-blue check, no padding. */
input[type="checkbox"], input[type="radio"] {
  width: 1.05rem; height: 1.05rem; min-width: 1.05rem; padding: 0; flex: none;
  accent-color: var(--blue-bright); border-radius: 4px;
}
input[type="radio"] { border-radius: 9999px; }
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }

/* ---- Tables ----------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
     color: var(--silver-300); font-weight: 600; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line-strong); }
td { padding: 0.75rem 0.85rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: rgba(255,255,255,0.025); }

/* ---- Focus visibility (a11y) ----------------------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue-bright); outline-offset: 2px; border-radius: 4px;
}
a { transition: color 0.15s ease; }
::selection { background: rgba(46,123,232,0.3); color: #fff; }

/* ---- Nav link (active underline / hover) ------------------------------ */
.nav-link { position: relative; transition: color 0.2s ease, background 0.2s ease; }

/* ---- Login hero entrance (CSS only, no JS) ---------------------------- */
@keyframes heroIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero-in > * { opacity: 0; animation: heroIn 0.7s cubic-bezier(0.22,1,0.36,1) forwards; }
.hero-in > *:nth-child(1) { animation-delay: 0.02s; }
.hero-in > *:nth-child(2) { animation-delay: 0.10s; }
.hero-in > *:nth-child(3) { animation-delay: 0.18s; }
.hero-in > *:nth-child(4) { animation-delay: 0.26s; }
.hero-in > *:nth-child(5) { animation-delay: 0.34s; }
.hero-in > *:nth-child(6) { animation-delay: 0.42s; }

@media (prefers-reduced-motion: reduce) {
  .hero-in > * { opacity: 1 !important; animation: none !important; }
  .btn, .card, tbody tr, a { transition: none !important; }
  html { scroll-behavior: auto !important; }
}

/* ---- Admin sidebar (M1) ------------------------------------------------
   Persistent left nav for owner/staff pages, replacing the old top "Menu ▾"
   dropdown. Desktop: fixed-width column (grid), collapsible to an icon rail.
   Below ~1024px: off-canvas drawer with a hamburger + overlay. State (open vs
   collapsed) persists via localStorage 'ph_sidebar', restored pre-paint so
   there's no flash (see base.html's inline <head> script). ------------------ */
:root { --sidebar-w: 248px; --sidebar-w-collapsed: 76px; }

#admin-sidebar {
  background: #000;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  width: var(--sidebar-w);
}
#sidebar-content-col { min-height: 100vh; }

/* Sidebar logo — kept prominent (~136px wide; the old top-nav pattern was ~144px TALL, a
   sidebar's narrow column makes width the right axis). Shrinks to a 34px mark when collapsed. */
#sidebar-logo { width: 136px; height: auto; display: block; transition: width 0.2s ease; }

/* Nav items — left-accent-bar active state + hover, reused for the transaction
   context-sidebar links too. */
.sidebar-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0.85rem; margin: 0 0 1px;
  border-left: 3px solid transparent; border-radius: 0 8px 8px 0;
  font-size: 0.85rem; font-weight: 500; color: var(--silver-200);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sidebar-item:hover { background: rgba(255,255,255,0.05); color: #EDEFF2; }
.sidebar-item.active { background: rgba(46,123,232,0.12); color: var(--blue-bright); border-left-color: var(--blue-bright); }
.sidebar-initial {
  display: none; height: 1.85rem; width: 1.85rem; min-width: 1.85rem; border-radius: 8px;
  background: rgba(255,255,255,0.06); align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.01em; flex: none; color: var(--silver-100);
}
.sidebar-item.active .sidebar-initial { background: rgba(46,123,232,0.18); color: var(--blue-bright); }
#sidebar-context-panel:empty { display: none; }
#sidebar-context-panel:not(:empty) { border-top: 1px solid var(--line); padding: 0.75rem 0.65rem; }

/* Desktop: sidebar participates in a 2-column grid; collapse shrinks it to an
   icon rail (labels hidden, initials shown). */
@media (min-width: 1024px) {
  .app-shell-with-sidebar { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
  html.ph-sidebar-collapsed .app-shell-with-sidebar { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
  #admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; transition: width 0.2s ease; }
  html.ph-sidebar-collapsed #admin-sidebar { width: var(--sidebar-w-collapsed); }
  html.ph-sidebar-collapsed #admin-sidebar .sidebar-label,
  html.ph-sidebar-collapsed #admin-sidebar #sidebar-account-email { display: none; }
  html.ph-sidebar-collapsed #admin-sidebar .sidebar-initial { display: flex; }
  html.ph-sidebar-collapsed #sidebar-logo { width: 34px; }
  html.ph-sidebar-collapsed #sidebar-collapse-icon { transform: rotate(180deg); }
  #sidebar-overlay { display: none; }
}

/* Below ~1024px: off-canvas drawer. Hidden by default (no flash — this rule
   has no JS/localStorage dependency), revealed only via .ph-sidebar-open. */
@media (max-width: 1023.98px) {
  #admin-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; height: 100vh; height: 100dvh;
    width: min(84vw, 300px); max-width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform 0.25s ease; overflow-y: auto;
  }
  html.ph-sidebar-open #admin-sidebar { transform: translateX(0); }
  #sidebar-collapse-toggle { display: none; }
  #sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 35;
  }
  html.ph-sidebar-open #sidebar-overlay { display: block; }
}
