/* /public_html/css/app.css
   BlueBeach unified stylesheet (FULL)
   Includes:
   - glass UI
   - bottom sheet modal
   - mobile smooth sheet scroll + focus fixes
   - terms page hard reset + scrollable document
   - glass footer
   - CTA buttons forced side-by-side at all resolutions
*/

:root{
  --bg:#628CB0;
  --glass:rgba(255,255,255,.16);
  --stroke:rgba(255,255,255,.22);
  --shadow:0 26px 80px rgba(0,0,0,.35);
  --r:26px;
  --safeTop: env(safe-area-inset-top,0px);
  --safeBottom: env(safe-area-inset-bottom,0px);
  --system:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%;margin:0}
html{-webkit-text-size-adjust:100%}

body{
  font-family:-apple-system,system-ui,Segoe UI,Roboto,Helvetica,Arial;
  background:var(--bg);
  color:white;

  /* NEW: footer can exist on the page */
  min-height:100svh;
  display:flex;
  flex-direction:column;
  overflow-x:hidden;
  overflow-y:auto;
}

/* stop iOS zoom */
input, textarea, select, button{ font-size:16px !important; }

/* background video */
video.bg{
  position:fixed; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  z-index:-3;
  filter:brightness(.92) contrast(1.06) saturate(1.05);
}

.overlay{
  position:fixed; inset:0;
  background:
    radial-gradient(950px 520px at 16% 18%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(900px 520px at 82% 22%, rgba(0,0,0,.22), transparent 62%),
    linear-gradient(180deg, rgba(11,18,32,.20), rgba(11,18,32,.86));
  z-index:-2;
}

.grain{
  position:fixed; inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode:overlay;
  opacity:.14;
  pointer-events:none;
  z-index:-1;
}

/* glass container */
.glass{
  background:var(--glass);
  border:1px solid var(--stroke);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  position:relative;
  isolation:isolate;
  overflow:hidden;
}
.glass::after{
  content:"";
  position:absolute; inset:0;
  background:rgba(0,0,0,.06);
  pointer-events:none;
  border-radius:inherit;
}

/* header */
header{
  padding-top:calc(14px + var(--safeTop));
  padding-left:16px; padding-right:16px;
  padding-bottom:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{display:flex;align-items:center;gap:12px}

.logo{
  width:44px;height:44px;border-radius:16px;
  background:rgba(255,255,255,.18);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 12px 35px rgba(0,0,0,.22);
  overflow:hidden;
}
.logo img{
  width:78%;height:78%;
  object-fit:contain;
  pointer-events:none;
}

.brandText strong{
  display:block;
  font-weight:950;
  letter-spacing:-.2px;
  line-height:1.05;
}
.brandText span{
  display:block;
  font-size:12px;
  font-weight:800;
  opacity:.9;
  margin-top:2px;
}

/* buttons */
.btn{
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.10);
  color:white;
  padding:12px 16px;
  border-radius:999px;
  font-weight:950;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.btn.primary{
  background:rgba(255,255,255,.92);
  color:#0b1220;
}

/* hero */
main{
  flex:1 0 auto;           /* NEW: takes remaining height */
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  padding-bottom:18px;
}


.card{
  width:min(860px,100%);
  padding:28px;
}

.tag{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:950;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.18);
}

h1{
  margin:14px 0 10px;
  font-size:clamp(32px,5vw,58px);
  line-height:1.05;
  letter-spacing:-.4px;
}

p{
  margin:0;
  opacity:.9;
  line-height:1.55;
  max-width:72ch;
  font-weight:850;
}

/* CTA: ALWAYS SIDE-BY-SIDE */
.cta{
  margin-top:18px;
  display:flex;
  flex-wrap:nowrap;          /* ?? never stack */
  gap:12px;
  align-items:stretch;
}
.cta .btn{
  flex:1 1 0;                /* evenly share space */
  min-width:0;
  text-align:center;
}
.cta .btn.primary{ flex:1.2 1 0; } /* optional emphasis */
.cta > *{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.status{
  margin-top:14px;
  font-size:13px;
  font-weight:900;
  opacity:.95;
}

/* bottom sheet modal */
.backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.55);
  display:none;
  z-index:60;
}
.backdrop.show{display:block}

.sheet{
  position:fixed; left:0; right:0; bottom:0;
  transform:translateY(110%);
  transition:.35s ease;
  z-index:70;
}
.sheet.show{transform:translateY(0)}

.sheetInner{
  max-width:560px;
  margin:auto;
  padding:18px;
  border-top-left-radius:30px;
  border-top-right-radius:30px;

  /* mobile smoothness */
  max-height: calc(92vh - var(--safeTop));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(18px + var(--safeBottom));
}

.grab{
  width:44px;height:5px;border-radius:999px;
  background:rgba(255,255,255,.38);
  margin:6px auto 12px;
}

.sheetTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.sheetTop h3{margin:0;font-weight:950;letter-spacing:-.2px}

.x{
  width:40px;height:40px;border-radius:999px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.18);
  color:white;
  font-weight:950;
  cursor:pointer;
}

/* form */
label{
  font-size:12px;
  font-weight:950;
  display:block;
  margin:12px 0 6px;
}

input,textarea,select{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.20);
  background:rgba(255,255,255,.10);
  color:white;
  font-weight:850;
  outline:none;
}

/* Fix browser autofill turning inputs white with invisible white text */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill{
  -webkit-text-fill-color:#fff;
  -webkit-box-shadow:0 0 0 1000px rgba(20,30,50,.95) inset;
  box-shadow:0 0 0 1000px rgba(20,30,50,.95) inset;
  border:1px solid rgba(255,255,255,.25);
  caret-color:#fff;
  transition:background-color 5000s ease-in-out 0s;
}

textarea{min-height:86px;resize:none}

.row{
  display:flex;
  gap:10px;
  align-items:center;
}

.toggle{
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.20);
  color:white;
  font-weight:950;
  cursor:pointer;
  flex:0 0 auto;
}

.hint{
  margin-top:10px;
  font-size:12px;
  font-weight:900;
  opacity:.95;
}

.switch{
  margin-top:10px;
  text-align:center;
  font-size:12px;
  font-weight:900;
  opacity:.95;
}
.switch button{
  background:none;
  border:none;
  color:white;
  font-weight:950;
  text-decoration:underline;
  cursor:pointer;
}

.smallNote{
  font-size:12px;
  font-weight:850;
  opacity:.85;
  margin-top:6px;
}

/* checkbox opt-in block */
.checkRow{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.20);
}
.checkRow input[type="checkbox"]{
  width:auto;
  margin-top:2px;
  padding:0;
  background:none;
  border:none;
  border-radius:0;
  flex-shrink:0;
  accent-color:var(--blue);
}
.checkRow .txt{
  font-size:12px;
  font-weight:850;
  opacity:.95;
  line-height:1.35;
  flex:1;
  min-width:0;
}

/* OTP boxes */
input.otp{
  text-align:center;
  font-weight:950;
  font-size:18px;
  padding:12px 0;
  border-radius:14px;
  width:100%;
}

/* responsive tweaks */
@media (max-width:520px){
  .card{padding:22px}
  header{padding-left:14px;padding-right:14px}
}

/* ================================
   BLUEBEACH GLASS FOOTER
   ================================ */

.bb-footer{
  padding:0;
  background:rgba(7,11,20,.92);
  backdrop-filter:blur(20px) saturate(1.4);
  -webkit-backdrop-filter:blur(20px) saturate(1.4);
  border-top:1px solid rgba(98,140,176,.1);
  font-family:var(--mono,'Space Mono',var(--sans,'DM Sans',system-ui,sans-serif));
  color:var(--txt,#edf1f5);
}

.bb-footer-inner{
  max-width:1200px;
  margin:0 auto;
  padding:18px 24px;
  padding-bottom:calc(18px + env(safe-area-inset-bottom));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  background:none;border:none;border-radius:0;
}

.bb-footer-title{
  font-weight:700;font-size:13px;
  letter-spacing:.02em;line-height:1.2;
}

.bb-footer-sub{
  margin-top:2px;
  font-size:8px;font-weight:700;
  letter-spacing:2px;opacity:.5;
  text-transform:uppercase;
}

.bb-footer-links{
  display:flex;
  gap:8px;
  flex-wrap:nowrap;
  justify-content:flex-end;
}

.bb-footer-link{
  display:inline-block;
  padding:8px 14px;
  border-radius:6px;
  border:1px solid rgba(98,140,176,.3);
  background:transparent;
  color:var(--txt,#edf1f5);
  text-decoration:none;
  font-weight:700;font-size:12px;
  white-space:nowrap;
  transition:background .15s;
}

.bb-footer-link:hover{background:rgba(98,140,176,.15)}

@media (max-width: 640px){
  .bb-footer-inner{
    flex-direction:column;
    align-items:flex-start;
    padding:14px 16px;
    padding-bottom:calc(14px + env(safe-area-inset-bottom));
  }
  .bb-footer-links{
    width:100%;
    justify-content:flex-start;
    flex-wrap:wrap;
  }
}

/* ================================
   TERMS PAGE HARD RESET (MUST BE LAST)
   ================================ */

body.terms-page{
  overflow: auto !important;
  height: auto !important;
  min-height: 100vh !important;
}

/* terms container */
body.terms-page main{
  height: auto !important;
  display:block !important;
  padding: 32px 20px 24px !important;
  max-width: 900px !important;
  margin: 0 auto !important;
}

/* make terms read like a document */
body.terms-page section,
body.terms-page p,
body.terms-page ul,
body.terms-page li{
  display:block !important;
  float:none !important;
  width:auto !important;
  max-width:none !important;
}

body.terms-page h1{
  font-size: clamp(30px, 5vw, 46px) !important;
  margin: 0 0 12px !important;
}
body.terms-page h2{
  margin-top: 40px !important;
  margin-bottom: 10px !important;
  font-size: 18px !important;
  font-weight: 900 !important;
}
body.terms-page p,
body.terms-page li{
  font-size: 15px !important;
  line-height: 1.75 !important;
  margin-bottom: 10px !important;
  opacity: .95 !important;
}
body.terms-page ul{
  padding-left: 22px !important;
  margin-top: 8px !important;
}

/* remove glass effect from terms main if you used it */
body.terms-page main.glass{
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

@media (max-width: 600px){
  body.terms-page main{
    padding: 24px 16px 18px !important;
  }
}
/* rows inside the signup modal */
.row.two { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.row.three { display:grid; grid-template-columns: 1fr 1fr 1fr; gap:10px; }

@media (max-width: 520px){
  .row.two, .row.three { grid-template-columns: 1fr; }
}

/* gender radio pills */
.radioPill{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.16);
  cursor:pointer;
  user-select:none;
}
.radioPill span{ opacity:.92; }
.radioPill input{
  width:18px;
  height:18px;
  margin:0;
}
button.x{
  background:none;
  border:0;
  padding:6px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

button.x img{
  width:18px;
  height:18px;
  opacity:.85;
  transition:opacity .15s ease, transform .08s ease;
}

button.x:hover img{
  opacity:1;
}

button.x:active img{
  transform:scale(.96);
}

.grab { cursor: pointer; }
.grab:active { transform: scaleX(.98); }
/* ---------- Mobile landscape responsiveness ---------- */
/* Targets short viewports (landscape phones) */
@media (max-height: 520px) and (orientation: landscape) {

  /* Give the page room */
  body {
    min-height: 100svh; /* better than 100vh on mobile */
  }

  /* Video background: keep it filling without weird cropping */
  video.bg {
    width: 100%;
    height: 100svh;
    object-fit: cover;
  }

  /* Tighten header so it doesn�t eat vertical space */
  header {
    padding: 10px 12px; /* adjust if your header has different padding */
  }

  header .brandText span {
    display: none; /* hide subtitle to save height */
  }

  /* Main hero card: reduce size + spacing */
  main {
    padding: 10px 12px;
  }

  body .card {
    padding: 14px;
  }

  body .card h1 {
    font-size: 28px;       /* smaller headline */
    line-height: 1.05;
    margin: 8px 0;
  }

  body .card p {
    font-size: 14px;
    margin: 8px 0 10px;
  }

  .cta {
    gap: 8px;
  }

  /* Bottom sheet: make it usable on short height */
  .sheet {
    align-items: flex-end; /* keep it anchored */
  }

  .sheet .sheetInner {
    max-height: 88svh;        /* key: prevent it from going offscreen */
    overflow-y: auto;          /* scroll inside the sheet */
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
  }

  /* Make form fields tighter */
  .sheet label { margin-top: 8px; }
  .sheet input,
  .sheet select,
  .sheet textarea {
    padding: 10px 10px;
  }

  /* Compact checkboxes in landscape — hide SMS text but keep TOS visible */
  #signupFields .checkRow { padding: 8px 10px; margin-top: 8px; }
  #signupFields .checkRow #smsOptIn ~ .txt { display: none; /* SMS opt-in text only */ }
  #signupFields .checkRow .txt { font-size: 11px; }
}

/* Extra: handle super short screens */
@media (max-height: 420px) and (orientation: landscape) {
  .card h1 { font-size: 24px; }
  .card p { display: none; }   /* optional: hide hero paragraph */
}
/* ================================
   LANDSCAPE PHONE FIX (FORCE)
   ================================ */

/* iPhone landscape: very short height */
@media (orientation: landscape) and (max-height: 520px) {

  /* anchor sheet to bottom and keep it inside screen */
  #sheet.sheet.show{
    bottom: 0 !important;
    top: auto !important;
  }

  /* THIS is the main fix: make the inner panel scroll and cap height */
  #sheet .sheetInner{
    max-height: 86svh !important;
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 12px !important;
  }

  /* sticky top so close is always reachable */
  #sheet .sheetTop{
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    padding: 10px 10px !important;
    margin: -12px -12px 10px -12px !important;
    background: rgba(0,0,0,.28) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
  }

  /* make those grid rows become single-column in landscape */
  #sheet .row.two,
  #sheet .row.three{
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* tighten vertical spacing */
  #sheet label{ margin: 8px 0 6px !important; }

  #sheet input,
  #sheet select,
  #sheet textarea{
    padding: 10px 10px !important;
  }

  /* hide SMS disclaimer text only (keeps TOS visible) */
  #sheet #signupFields #smsOptIn ~ .txt{
    display: none !important;
  }
  #sheet #signupFields .checkRow .txt{ font-size: 11px !important; }
}

/* super-short devices */
@media (orientation: landscape) and (max-height: 420px) {
  #sheet .sheetInner{ max-height: 82svh !important; }
}
/* ---------- FIX header overlap in mobile landscape ---------- */
@media (max-height: 520px) and (orientation: landscape) {

  /* Make header occupy real space (not overlaying content) */
  header {
    position: relative;
    z-index: 10;
    margin-bottom: 12px;
  }

  /* Push main content below header */
  main {
    margin-top: 12px;
  }

  /* If header buttons were absolute/fixed, normalize them */
  #authButtons {
    position: relative;
    top: auto;
    right: auto;
  }

  /* Hero card should never slide under header */
  .card {
    margin-top: 8px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  header {
    position: static !important;
  }
}
/* ---------- MEMBERS: mobile landscape layout fix ---------- */
@media (max-height: 520px) and (orientation: landscape) {

  /* Ensure the middle grid row can shrink without pushing upward */
  .wrap{
    grid-template-rows: auto minmax(0,1fr) auto;
  }

  /* Keep header above and prevent overlay/bleed */
  .topbar{
    position: relative;
    z-index: 10;
  }

  /* Let the main area scroll if needed (instead of overlapping) */
  .body{
    min-height: 0;          /* critical inside CSS grid */
    overflow: auto;         /* allow scrolling in landscape */
    -webkit-overflow-scrolling: touch;
  }

  /* Optional: tighten header a bit */
  .topbar{
    padding-bottom: 8px;
  }
}

/* ================================
   ACCESSIBILITY — Keyboard focus outlines
   ================================ */
*:focus-visible{outline:2px solid #628CB0;outline-offset:2px;border-radius:4px}

/* ================================
   ACCESSIBILITY — Screen reader only
   ================================ */
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ================================
   UTILITY CLASSES
   ================================ */
.visually-hidden{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.flex-center{display:flex;align-items:center;justify-content:center}

/* ================================
   ACCESSIBILITY — Reduced motion
   ================================ */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.01ms !important;
    scroll-behavior:auto !important;
  }
}

/* ================================
   Light mode — future enhancement
   ================================ */
@media (prefers-color-scheme: light){
  /* Light mode — future enhancement */
}

/* ================================
   PRINT STYLESHEET
   ================================ */
@media print{
  .bb-topbar,.bb-footer,.sheet,.modal{display:none !important}
  body{background:#fff;color:#000}
}
