:root {
  --onyx: #131417;
  --coffee-bean: #251E1C;
  --cinnamon-wood: #B58269;
  --ash-brown: #5E483D;
  --gunmetal: #3D3E42;
  --white: #FFFFFF;
  --text-secondary: #9A8E86;
  --input-bg: #1E1E22;
  --danger: #8B3A3A;
  --success: #3D6B3D;
  --warning: #8B7A3A;
  --radius: 8px;
  --radius-lg: 12px;
  --tap-min: 48px;
  --transition: 0.2s ease;
}

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

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--white);
  background: var(--onyx);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

a { color: var(--cinnamon-wood); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── AUTH SCREEN ──────────────────── */

[hidden] { display: none !important; }

.portal-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.portal-auth__card {
  width: 100%;
  max-width: 400px;
  background: var(--coffee-bean);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.portal-auth__logo {
  display: block;
  text-align: center;
  margin-bottom: 0.25rem;
}

.portal-auth__logo:hover { text-decoration: none; opacity: 0.9; }

.portal-auth__logo-img {
  height: 56px;
  width: auto;
}

.portal-auth__sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin: 0 0 2rem;
}

.portal-auth__toggle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 1.25rem;
}

.portal-auth__banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(61,107,61,0.25);
  color: #7bc97b;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  animation: portal-toast-in 0.3s ease;
}

.portal-auth__banner svg { flex-shrink: 0; stroke: #7bc97b; align-self: flex-start; margin-top: 2px; }

.portal-spam-notice {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.portal-spam-notice strong { color: #e6d47a; }

.portal-auth__desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 1rem;
  line-height: 1.5;
}

/* ── FORMS & INPUTS ──────────────── */

.portal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-input {
  width: 100%;
  min-height: var(--tap-min);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--white);
  background: var(--input-bg);
  border: 2px solid var(--ash-brown);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.portal-input:focus {
  outline: none;
  border-color: var(--cinnamon-wood);
  box-shadow: 0 0 0 3px rgba(181,130,105,0.25);
}

textarea.portal-input { resize: vertical; min-height: 80px; }

select.portal-input {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239A8E86' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.portal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
}

.portal-checkbox input {
  margin-top: 0.2rem;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--cinnamon-wood);
  flex-shrink: 0;
}

/* ── LABELS ──────────────────────── */

.portal-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: -0.25rem;
}

/* ── PASSWORD TOGGLE ─────────────── */

.portal-pw-wrap {
  position: relative;
}

.portal-pw-wrap .portal-input {
  padding-right: 3rem;
}

.portal-pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: color var(--transition);
}

.portal-pw-toggle:hover { color: var(--white); }

/* ── PASSWORD STRENGTH ───────────── */

.portal-pw-strength {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: -0.25rem;
}

.portal-pw-strength__bar {
  flex: 1;
  height: 4px;
  background: var(--gunmetal);
  border-radius: 999px;
  overflow: hidden;
}

.portal-pw-strength__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease, background-color 0.3s ease;
  width: 0%;
}

.portal-pw-strength__label {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.portal-pw-strength--weak .portal-pw-strength__fill { width: 25%; background: var(--danger); }
.portal-pw-strength--weak .portal-pw-strength__label { color: #e07a7a; }

.portal-pw-strength--fair .portal-pw-strength__fill { width: 50%; background: var(--warning); }
.portal-pw-strength--fair .portal-pw-strength__label { color: #e6d47a; }

.portal-pw-strength--good .portal-pw-strength__fill { width: 75%; background: var(--cinnamon-wood); }
.portal-pw-strength--good .portal-pw-strength__label { color: #e6b89a; }

.portal-pw-strength--strong .portal-pw-strength__fill { width: 100%; background: var(--success); }
.portal-pw-strength--strong .portal-pw-strength__label { color: #7bc97b; }

/* ── FIELD ERRORS ────────────────── */

.portal-field-error {
  font-size: 0.8rem;
  color: #e07a7a;
  margin-top: -0.25rem;
}

.portal-input--error {
  border-color: var(--danger) !important;
}

.portal-input--success {
  border-color: var(--success) !important;
}

/* ── BUTTONS ─────────────────────── */

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
}

.portal-btn:active { transform: scale(0.98); }

.portal-btn--primary { background: var(--cinnamon-wood); color: var(--white); }
.portal-btn--primary:hover { background: #b87d5f; }
.portal-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }

.portal-btn--outline {
  background: transparent;
  color: var(--cinnamon-wood);
  border: 2px solid var(--cinnamon-wood);
}
.portal-btn--outline:hover { background: rgba(181,130,105,0.15); }

.portal-btn--ghost { background: transparent; color: var(--text-secondary); }
.portal-btn--ghost:hover { background: var(--gunmetal); color: var(--white); }

.portal-btn--danger { background: var(--danger); color: var(--white); }

/* ── HEADER ──────────────────────── */

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gunmetal);
  background: var(--coffee-bean);
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal-header__left { display: flex; align-items: center; gap: 1rem; }

.portal-header__logo {
  display: flex;
  align-items: center;
}

.portal-header__logo-img {
  height: 32px;
  width: auto;
}

.portal-header__greeting {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── LAYOUT ──────────────────────── */

.portal-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ── SECTIONS ────────────────────── */

.portal-section {
  margin-bottom: 2rem;
}

.portal-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.portal-section__title {
  font-size: 1.1rem;
  margin: 0;
}

.portal-section__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}

/* ── CARDS ────────────────────────── */

.portal-card {
  background: var(--coffee-bean);
  border: 1px solid var(--gunmetal);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition);
}

.portal-card:hover { border-color: var(--ash-brown); }

.portal-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portal-card__name { font-weight: 700; font-size: 1.05rem; }
.portal-card__meta { color: var(--text-secondary); font-size: 0.85rem; margin-top: 0.25rem; }

.portal-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* ── BADGES ──────────────────────── */

.portal-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 999px;
}

.portal-badge--pending { background: rgba(181,130,105,0.4); color: #e6b89a; }
.portal-badge--approved { background: rgba(61,107,61,0.4); color: #7bc97b; }
.portal-badge--rejected { background: rgba(139,58,58,0.4); color: #e07a7a; }
.portal-badge--valid { background: rgba(61,107,61,0.4); color: #7bc97b; }
.portal-badge--expired { background: rgba(139,58,58,0.4); color: #e07a7a; }
.portal-badge--paid { background: rgba(61,107,61,0.4); color: #7bc97b; }
.portal-badge--confirmed { background: rgba(61,107,61,0.4); color: #7bc97b; }
.portal-badge--cancelled { background: rgba(139,58,58,0.4); color: #e07a7a; }

/* ── PRICING CARDS ───────────────── */

.portal-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.portal-pricing__card {
  position: relative;
  background: var(--coffee-bean);
  border: 1px solid var(--gunmetal);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.portal-pricing__card--featured {
  border-color: var(--cinnamon-wood);
  box-shadow: 0 0 20px rgba(181,130,105,0.15);
}

.portal-pricing__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cinnamon-wood);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 999px;
}

.portal-pricing__card h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.portal-pricing__price { font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; margin: 0.25rem 0; }
.portal-pricing__card p { color: var(--text-secondary); font-size: 0.85rem; margin: 0 0 1rem; }

.portal-pricing__card .portal-btn { width: 100%; }

/* ── SESSION CARDS ───────────────── */

.portal-session-card {
  background: var(--coffee-bean);
  border: 1px solid var(--gunmetal);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-session-card__info { flex: 1; min-width: 0; }
.portal-session-card__date { font-weight: 700; }
.portal-session-card__meta { color: var(--text-secondary); font-size: 0.85rem; margin-top: 0.15rem; }

/* ── WAIVER SCROLL ───────────────── */

.waiver-scroll {
  max-height: 200px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--input-bg);
  border: 2px solid var(--ash-brown);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.waiver-scroll h4 { color: var(--white); margin-bottom: 0.5rem; }
.waiver-scroll a { color: var(--cinnamon-wood); }

/* ── MODALS ──────────────────────── */

.portal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.portal-modal-overlay.active { opacity: 1; visibility: visible; }

.portal-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--coffee-bean);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform var(--transition);
}

.portal-modal-overlay.active .portal-modal { transform: scale(1); }

.portal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.portal-modal__close {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  border-radius: var(--radius);
}

.portal-modal__close:hover { color: var(--white); background: var(--gunmetal); }

/* ── TOAST ────────────────────────── */

.portal-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9rem;
  z-index: 400;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: portal-toast-in 0.3s ease;
  max-width: 90vw;
  text-align: center;
}

.portal-toast--success { background: var(--success); color: var(--white); }
.portal-toast--error { background: var(--danger); color: var(--white); }
.portal-toast--info { background: var(--gunmetal); color: var(--white); }

@keyframes portal-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── EMPTY STATE ─────────────────── */

.portal-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
}

.portal-empty__icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.5; }
.portal-empty__text { font-size: 0.9rem; }

/* ── PROGRESS BAR ────────────────── */

.portal-progress {
  height: 6px;
  background: var(--gunmetal);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.portal-progress__fill {
  height: 100%;
  background: var(--cinnamon-wood);
  border-radius: 999px;
  transition: width var(--transition);
}

/* ── PRICING FEATURES ────────────── */

.portal-pricing__features {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  text-align: left;
}

.portal-pricing__features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.2rem 0;
  line-height: 1.5;
}

.portal-pricing__features li::before {
  content: "\2713\00a0";
  color: var(--cinnamon-wood);
  font-weight: 700;
}

/* ── RESPONSIVE ──────────────────── */

@media (max-width: 480px) {
  .portal-auth__card { padding: 2rem 1.25rem; }
  .portal-pricing { grid-template-columns: 1fr; }
}
