/* =====================================================
   /assets/css/access.css
   EventHub — sign in / sign up / reset (pre-auth)

   "The ballroom at 8:40pm" — matched to the marketing site
   (eventhubpro.com): ink night background with the blue
   stage glow, board-style card, Bricolage Grotesque display
   type, paddle-red primary buttons.

   Mobile-first, full-screen on phones, no input auto-zoom.
   Pages must load the Google Fonts bundle:
   Bricolage Grotesque + Public Sans + DM Mono.
   ===================================================== */

/* ---------- Tokens (ballroom) ---------- */
:root {
  --ink: #151C26;           /* house lights down   */
  --ink-2: #1D2733;         /* raised surface      */
  --blue: #5E7C9E;          /* EventHub brand      */
  --blue-lift: #9CB6D2;     /* brand, lit          */
  --paddle: #C8443C;        /* the paddle itself   */
  --paddle-lift: #E0685E;
  --chalk: #EDF1F5;
  --muted: #93A2B4;   /* was #7E8DA0 — under 4.5:1 on the card gradient (WCAG 1.4.3) */
  --muted-2: #B9C4D2;
  --hairline: rgba(156, 182, 210, 0.18);
  --hairline-strong: rgba(156, 182, 210, 0.25);

  --eh-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);

  --eh-radius: 10px;
  --eh-radius-sm: 6px;
  --eh-font-display: "Bricolage Grotesque", var(--font-display, system-ui), sans-serif;
  --eh-font-body: "Public Sans", var(--font-body, system-ui), sans-serif;
  --eh-font-data: "DM Mono", ui-monospace, monospace;
}

/* ---------- Base reset ---------- */
* { -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--eh-font-body);
  color: var(--chalk);
  min-height: 100dvh;

  /* the stage glow from the marketing hero */
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(94, 124, 158, 0.30), transparent 70%),
    var(--ink);
  background-attachment: fixed;

  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 12px 3vh;

  overflow-x: hidden;
  overflow-y: auto;

  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* Prevent iOS input auto-zoom — must stay >= 16px */
input, select, textarea {
  font-size: 16px !important;
  font-family: var(--eh-font-body);
}

/* Autofill — keep the dark input, chalk ink */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--chalk);
  -webkit-box-shadow: 0 0 0 1000px #232E3C inset;
  transition: background-color 9999s ease-out 0s;
}

/* ---------- Container ---------- */
.login-container {
  width: 100%;
  max-width: 420px;
  padding: 0 4px;
}

/* ---------- Card: the board ---------- */
.card {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--eh-radius);
  background: linear-gradient(180deg, #223040, #18212C);
  color: var(--chalk);
  box-shadow: var(--eh-shadow);
  overflow: hidden;
}

.card .card-img-top {
  width: 100%;
  height: auto;
  max-height: 168px;
  object-fit: contain;
  background: transparent;
  padding: 22px 20px 8px;
  border-bottom: 1px solid var(--hairline);
}

/* ---------- Card body ---------- */
.card .card-body { padding: 1.5rem 1.5rem 1.25rem; }

/* Bootstrap utility overrides for the dark card */
.card .text-body { color: var(--chalk) !important; }
.card .text-muted, .card .small.text-muted { color: var(--muted) !important; }

/* ---------- Title ---------- */
.card-title {
  font-family: var(--eh-font-display);
  font-optical-sizing: auto;
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--chalk) !important;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.7rem;
}

.card-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 42px;
  height: 4px;
  border-radius: 3px;
  background: var(--paddle);
}

/* ---------- Inputs ---------- */
.form-control {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--eh-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--chalk);
  padding: 0.85rem 0.9rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control::placeholder { color: var(--muted); }   /* no opacity — it halved the contrast */

.form-control:hover { border-color: rgba(156, 182, 210, 0.45); }

.form-control:focus {
  border-color: var(--blue-lift);
  box-shadow: 0 0 0 4px rgba(156, 182, 210, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--chalk);
}

/* Floating labels — quiet mono-adjacent gray, lit on focus */
.form-floating > label {
  color: var(--muted);
  font-weight: 500;
  padding: 0.9rem;
}
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--muted);
  opacity: 0.85;
}
.form-floating > .form-control:focus ~ label {
  color: var(--blue-lift);
  opacity: 0.95;
}
/* Bootstrap 5 paints the floated label pill with ::after — kill it on dark */
.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after {
  background: transparent !important;
}

/* Validation */
.form-control.is-invalid { border-color: var(--paddle-lift); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(224, 104, 94, 0.22); }
.invalid-feedback { color: var(--paddle-lift); font-weight: 500; }
.text-danger { color: var(--paddle-lift) !important; }

/* ---------- Buttons: the paddle ---------- */
.btn {
  font-family: var(--eh-font-body);
  font-weight: 600;
  border-radius: 4px;
  min-height: 48px;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, filter 0.15s ease, background-color 0.2s ease;
}

.btn-primary,
.btn-primary:not(:disabled):not(.disabled) {
  background-color: var(--paddle) !important;
  border-color: var(--paddle) !important;
  color: #fff !important;
  box-shadow: 0 10px 26px -8px rgba(200, 68, 60, 0.55);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled):hover {
  background-color: var(--paddle) !important;
  border-color: var(--paddle) !important;
  color: #fff !important;
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 14px 30px -8px rgba(200, 68, 60, 0.6);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled,
.btn-primary.disabled {
  background-color: #5A6675 !important;
  border-color: #5A6675 !important;
  box-shadow: none;
  opacity: 1;
}

.btn-success {
  /* #2E9E63 left the white label at ~3.4:1 (WCAG 1.4.3). */
  background-color: #27865A;
  border: none;
  box-shadow: 0 10px 26px -8px rgba(46, 158, 99, 0.5);
}
.btn-success:hover { background-color: #27865A; filter: brightness(1.08); transform: translateY(-1px); }

.btn:focus-visible,
.form-control:focus-visible {
  outline: 2px solid var(--blue-lift);
  outline-offset: 3px;
}

/* ---------- Card footer (links) ---------- */
.card .card-footer {
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--hairline);
  padding: 0.5rem 0.75rem;
}

.card-footer .btn {
  color: var(--muted-2) !important;
  font-weight: 600;
  min-height: auto;
  background: transparent;
  box-shadow: none;
  transition: color 0.18s ease;
}
.card-footer .btn:hover {
  color: #fff !important;
  transform: none;
  filter: none;
}

/* ---------- Messages ---------- */
.missingcaptcha,
#signinmsg { font-weight: 500; font-size: 0.92rem; }

/* ---------- OTP digit inputs ---------- */
#showotpform .digit {
  width: 3rem;
  height: 3.25rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 500;
  font-family: var(--eh-font-data);
  color: var(--chalk);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--eh-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#showotpform .digit:focus {
  border-color: var(--blue-lift);
  box-shadow: 0 0 0 4px rgba(156, 182, 210, 0.18);
  outline: none;
}

#showotpform input.digit.otp-filled {
  background-color: rgba(52, 199, 123, 0.12);
  border-color: rgba(52, 199, 123, 0.45);
  box-shadow: 0 0 0 3px rgba(52, 199, 123, 0.15);
}

/* ---------- Success panels ---------- */
.alert-success {
  background: rgba(52, 199, 123, 0.10);
  border: 1px solid rgba(52, 199, 123, 0.30);
  color: #4ADE80;
  border-radius: var(--eh-radius-sm);
}

/* =====================================================
   FORCED PASSWORD CHANGE MODAL
   ===================================================== */
#forcedPasswordModal .modal-content {
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--eh-radius);
  box-shadow: var(--eh-shadow);
  background: linear-gradient(180deg, #223040, #18212C);
  color: var(--chalk);
}

#forcedPasswordModal .modal-header {
  background: rgba(94, 124, 158, 0.12);
  border-bottom: 1px solid var(--hairline);
}

#forcedPasswordModal .modal-title {
  font-family: var(--eh-font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--chalk);
}

#forcedPasswordModal .form-control,
#forcedPasswordModal .btn { border-radius: var(--eh-radius-sm); }

#forcedPasswordModal .input-group > .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#forcedPasswordModal .input-group > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  min-width: 82px;
  min-height: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline-strong);
  color: var(--muted-2);
}
#forcedPasswordModal .input-group > .btn:hover { color: #fff; transform: none; filter: none; }

#fp_user_email {
  display: flex;
  align-items: center;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--eh-radius-sm);
  color: var(--chalk);
}

#fp_password_rules li.ok  { color: #4ADE80; font-weight: 600; }
#fp_password_rules li.bad { color: var(--paddle-lift); }

/* =====================================================
   MOBILE FULL-SCREEN MODE
   ===================================================== */
@media (max-width: 576px) {
  body { padding: 0; align-items: stretch; }

  .login-container {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    padding: 0;
  }

  .card {
    margin: 0;
    border: none;
    border-radius: 0;
    width: 100%;
    min-height: 100dvh;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
  }

  .card .card-img-top { max-height: 132px; padding: 18px 20px 6px; }

  .card .card-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1.25rem 1.15rem;
  }

  .card .card-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: #18212C;
    padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
  }

  .card-title { font-size: 1.45rem; }

  button, input, a, .btn { touch-action: manipulation; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =====================================================
   BRAND LOCKUP — the marketing site's logo, in CSS
   Markup (unchanged):
     <div class="eh-brand">
       <div class="eh-monogram" aria-hidden="true">EH</div>
       <div class="eh-wordmark">Event Hub</div>
     </div>
   The monogram is the paddle: a red tag, tipped -6deg, the
   same mark the marketing nav wears.
   ===================================================== */
.eh-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 30px 20px 12px;
  background: transparent;
}

.eh-monogram {
  width: 34px;
  height: 40px;
  border-radius: 4px;
  background: var(--paddle);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--eh-font-data);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0;
  line-height: 1;
  transform: rotate(-6deg);
  box-shadow: 0 10px 22px -8px rgba(200, 68, 60, 0.55);
  user-select: none;
}

.eh-wordmark {
  font-family: var(--eh-font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-transform: none;
}

@media (max-width: 576px) {
  .eh-brand { padding: 26px 20px 10px; gap: 10px; }
  .eh-monogram { width: 30px; height: 36px; font-size: 0.85rem; }
  .eh-wordmark { font-size: 1.35rem; }
}

/* =========================================================
   PASSWORD LENGTH FEEDBACK (signup)
   ========================================================= */
.pw-meter { padding: 0 0.25rem; }

.pw-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.pw-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--paddle-lift);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.pw-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

/* Drawn in CSS: the signup page loads no icon font. */
.pw-icon::before {
  content: '\25CB';
  font-size: 0.9rem;
  line-height: 1;
}

.pw-status.is-ok  { color: #4ADE80; }
.pw-status.is-ok  .pw-icon::before { content: '\2713'; }
.pw-status.is-bad { color: var(--paddle-lift); }
.pw-status.is-bad .pw-icon::before { content: '\2717'; }

@media (prefers-reduced-motion: reduce) {
  .pw-bar-fill, .pw-status { transition: none; }
}

/* ---------- Legal footer: bottom middle of every access page ---------- */
.access-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 20px 0 10px;
  font-family: var(--eh-font-data);
  font-size: 12px;
  color: var(--muted);
}

.access-foot a {
  color: #8B98A9;
  text-decoration: none;
  transition: color 0.15s ease;
}

.access-foot a:hover { color: var(--blue-lift); }

@media (max-width: 576px) {
  .access-foot {
    margin: 14px 0 calc(14px + env(safe-area-inset-bottom));
  }
}

/* The lockup is a link home — dress like the static version, lift on hover */
a.eh-brand {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}
a.eh-brand:hover { transform: translateY(-1px); }
a.eh-brand:hover .eh-wordmark { color: var(--blue-lift); }
