/* =========================================================
   CoachFollow — Zoom-style Light Theme (PWA + landing)
   Keeps your existing class names; updates the look.
   ========================================================= */

:root{
  /* Core */
  --bg: #ffffff;
  --soft: #f5f7fb;
  --soft2:#eef3ff;
  --text:#0b1220;
  --muted:#52606d;
  --muted2:#6b7a88;
  --line: rgba(11,18,32,.12);
  --line2: rgba(11,18,32,.08);

  /* Brand */
  --brand:#2f6fac;
  --brand2:#3b82f6;

  /* Radius / shadow */
  --r12: 12px;
  --r14: 14px;
  --r18: 18px;
  --r22: 22px;

  --shadow: 0 18px 45px rgba(11,18,32,.10);
  --shadow2: 0 10px 26px rgba(11,18,32,.10);

  /* Layout */
  --sidew: 260px;
  --topbarh: 56px;

  /* Content width (prevents clunky stretched desktop) */
  --contentw: 1120px;
}

/* =========================================================
   App base
   ========================================================= */

*{ box-sizing: border-box; }



body{
  margin:0;
  color: var(--text);
  background: linear-gradient(180deg, var(--soft) 0%, #ffffff 35%, #ffffff 100%);
  padding-bottom: calc(74px + env(safe-area-inset-bottom)); /* space for bottom nav + iOS safe area */
}

/* Force-hide utility + native hidden */
.u-hidden { display: none !important; }
[hidden] { display: none !important; }

/* A safe, consistent page padding wrapper */
.container{
  padding: 16px;
  max-width: var(--contentw);
  margin: 0 auto;
}

/* =========================================================
   Typography helpers
   ========================================================= */

.hint{
  font-size: 12.5px;
  color: var(--muted);
}
.label{
  font-size: 12px;
  font-weight: 800;
  color: var(--muted2);
}
.value{
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
}
.link{
  color: var(--brand);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
   Screen layout
   ========================================================= */

.screen{
  display: grid;
  gap: 12px;
  padding: 10px 0;
  max-width: var(--contentw);
  margin: 0 auto;
}

.screen-header{ padding: 4px 2px; }

.screen-title{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.screen-subtitle{
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.screen-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 8px;
}

/* =========================================================
   Cards (Zoom-like)
   ========================================================= */

.card{
  border-radius: var(--r22);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow);
  padding: 14px;
}

/* FIX: home.html has cards inside cards — make inner cards lighter/cleaner */
.card .card{
  box-shadow: none;
  background: var(--soft);
  border-color: var(--line2);
}

/* Optional: slightly tighter inner-card padding */
.card .card{ padding: 12px; }

.card-title{
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--text);
}

.divider{
  height: 1px;
  background: var(--line2);
  margin: 12px 0;
}

/* Lists */
.list{
  margin: 0;
  padding-left: 18px;
  color: rgba(11,18,32,.78);
  font-size: 14px;
}
.list-cards{ display:grid; gap:12px; }
.card-link{ text-decoration:none; color:inherit; }

/* =========================================================
   Row layout
   ========================================================= */

.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 8px;
}
@media (max-width: 420px){
  .row{ align-items:flex-start; }
}

/* =========================================================
   App shell + topbar
   ========================================================= */

/* default mobile/tablet */
.app-shell{
  min-height: 100vh;
}

/* Make main content feel “centered” not stretched */
.app-main{
  padding: 16px;
  max-width: var(--contentw);
  margin: 0 auto;
  padding-bottom:100px;
}

.app-main{
  overflow: auto;                 /* must be scroll container */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* Topbar base styles (works on both mobile + desktop) */
.topbar{
  position: sticky;
  top: 0;
  height: var(--topbarh);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 0 14px;

  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);

  z-index: 1000;
}

.topbar-title{
  font-weight: 900;
  color: rgba(11,18,32,.92);
  letter-spacing: -0.01em;
}

.topbar-menu-btn{
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 12px;
  height: 38px;
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
}
.topbar-menu-btn:active{ opacity: .9; }

/* Sidebar (light) - base hidden */
.side-nav{ display:none; }

/* =========================================================
   Desktop layout frame
   ========================================================= */

@media (min-width: 768px){

  /* show fixed sidebar */
  .side-nav{
    display:flex;
    flex-direction:column;
    position:fixed;
    top:0; left:0;
    width: var(--sidew);
    height: 100vh;
    padding: 16px;
    gap: 8px;

    background: rgba(255,255,255,.96);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(10px);
    z-index: 1100;
  }

  .sn-brand{
    text-decoration:none;
    color: rgba(11,18,32,.95);
    font-weight: 900;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--soft);
    margin-bottom: 6px;
  }

  .sn-item{
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    text-decoration:none;
    color: rgba(11,18,32,.78);
    border: 1px solid var(--line2);
    background: #fff;
    font-weight: 800;
  }

  .sn-item:hover{ background: var(--soft); }
  .sn-ico{ width: 22px; text-align:center; }

  .sn-item.active{
    color: rgba(11,18,32,.95);
    border-color: rgba(47,111,172,.25);
    background: linear-gradient(135deg, rgba(47,111,172,.12), rgba(59,130,246,.08));
  }

  /* shift the entire content frame right */
  .app-shell{
    margin-left: var(--sidew);
  }

  /* topbar should align with content frame (not full viewport) */
  .topbar{
    padding: 0 22px;
  }

  /* ensure main content breathes */
  .app-main{
    padding: 22px;
    padding-bottom:100px;
  }

  /* Hide bottom nav on desktop + remove mobile padding */
  .bottom-nav{ display:none; }
  body{ padding-bottom: 0; }

  /* Optional: hide hamburger on desktop if you want */
  /* .topbar-menu-btn{ display:none; } */
}

/* =========================================================
   Bottom nav (light)
   ========================================================= */

/* Hide bottom nav on larger devices/tablets too */
@media (min-width: 768px){
  .bottom-nav{ display: none !important; }
  body{ padding-bottom: 0; }

}
/* Hide bottom nav on larger devices/tablets too */
@media (max-width: 768px){
  .not{ display: none !important; }

}
.bottom-nav{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 10000;
  background: rgba(255,255,255,.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.bn-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 2px;
  text-decoration:none;
  color: rgba(11,18,32,.58);
  font-size: 12px;
}

.bn-icon{ font-size: 20px; line-height: 1; }

.bn-item.active{
  color: rgba(11,18,32,.92);
  font-weight: 800;
}
.bn-item:active{ background: rgba(11,18,32,.04); }

/* =========================================================
   Drawer (light)
   ========================================================= */

.drawer-overlay{
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,0.35);
  z-index: 9999;
}

.drawer{
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(320px, 88vw);
  z-index: 10000;
  background: rgba(255,255,255,.96);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: -8px 0 24px rgba(11,18,32,0.18);
}

.drawer-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-title{ font-weight: 900; color: rgba(11,18,32,.92); }

.drawer-close{
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--r12);
  padding: 6px 10px;
}
.drawer-close:active{ opacity: .9; }

.drawer-content{
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.drawer-link{
  padding: 10px;
  border-radius: 12px;
  text-decoration:none;
  color: rgba(11,18,32,.92);
  background: #fff;
  border: 1px solid var(--line);
}
.drawer-link:active{ opacity:.92; }

.drawer-sep{ height: 1px; background: var(--line2); margin: 10px 0; }

/* =========================================================
   Forms / fields (light)
   ========================================================= */

.field{ display:grid; gap: 10px; }

.field-label {
    font-size: 16px;
    font-weight: 900;
    color: rgba(11, 18, 32, .75);
    margin-top: 10px;
}

.field-input{
  height: 48px;
  padding: 0 14px;
  border-radius: var(--r14);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 16px; /* prevents iOS zoom */
  outline: none;
  width: 100%;
}

.field-input:focus{
  border-color: rgba(59,130,246,.45);
  box-shadow: 0 0 0 4px rgba(59,130,246,.16);
}
textarea.field-input{ height:auto; padding: 12px 14px; }

/* =========================================================
   Buttons
   ========================================================= */

.btn{
  height: 44px;
  border-radius: var(--r14);
  padding: 0 14px;
  font-weight: 900;
  font-size: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  cursor:pointer;
  transition: transform .08s ease, opacity .12s ease, background .12s ease;
  margin-top:10px;
}
.btn:active{ transform: scale(.99); opacity: .95; }

.btn-sm{ height: 38px; padding: 0 12px; font-size: 13px; }
.btn-full{ width: 100%; }

.btn-primary{
  border-color: rgba(47,111,172,.28);
  background: linear-gradient(135deg, rgba(47,111,172,.95), rgba(59,130,246,.85));
  box-shadow: 0 12px 30px rgba(47,111,172,.18);
  color: #fff;
}

.btn-ghost{
  background: var(--soft);
  color: rgba(11,18,32,.92);
  border-color: var(--line);
}

/* Back button */
.back-btn{
  display:inline-flex;
  align-items:center;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  background: var(--soft);
  color: rgba(11,18,32,.92);
  border: 1px solid var(--line);
}
.back-btn:active{ opacity: .92; }

/* =========================================================
   Pills
   ========================================================= */

.pill{
  display:inline-flex;
  align-items:center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--line);
  background: var(--soft);
  color: rgba(11,18,32,.78);
}

.pill-ok{
  background: rgba(16,185,129,.14);
  border-color: rgba(16,185,129,.18);
  color: rgba(6,95,70,.92);
}

.pill-muted{
  background: var(--soft);
  border-color: var(--line);
  color: rgba(11,18,32,.78);
}

/* =========================================================
   FAB
   ========================================================= */

.fab{
  position:fixed;
  right:16px;
  bottom: calc(100px + env(safe-area-inset-bottom));
  width:56px;
  height:56px;
  border-radius:50%;
  background: linear-gradient(135deg, rgba(47,111,172,.95), rgba(59,130,246,.85));
  color:#fff;
  font-size:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  box-shadow: 0 12px 30px rgba(47,111,172,.18);
}

/* =========================
   MODAL (FULL DROP-IN)
   Fixes: top cut off on mobile + tall modal scroll
   Requires: wrap modal content in .modal-body (see HTML snippet at bottom)
   ========================= */

/* Prevent page scroll when modal is open (toggle this class on <body>) */
.modal-open{ overflow: hidden; }

/* Backdrop */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
}

.modal[hidden],
.modal-backdrop[hidden]{ display:none !important; }

/* Overlay */
.modal{
  position: fixed;
  inset: 0;
  z-index: 2100;

  display:flex;
  justify-content:center;

  /* ✅ desktop default: center so the top never gets clipped */
  align-items:center;

  /* breathing room + iOS safe areas */
  padding: 12px;
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-bottom: calc(12px + env(safe-area-inset-bottom));

  /* ✅ allow overlay to scroll if the card is taller than the viewport */
  overflow: auto;

  /* smooth scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

/* ✅ mobile: keep your bottom-sheet feel + keep clear of bottom bar */
@media (max-width: 640px){
  .modal{
    align-items:flex-end;
    padding-bottom: calc(12px + env(safe-area-inset-bottom) + 70px);
  }
}

/* Card */
.modal-card{
  width: 100%;
  max-width: 520px;
  border-radius: var(--r22);
  background: rgba(255,255,255,.98);
  border: 1px solid var(--line);
  box-shadow: 0 28px 90px rgba(11,18,32,.28);

  padding: 14px;

  /* ✅ key changes: make it a column with internal scroll */
  display:flex;
  flex-direction:column;
  overflow:hidden;

  /* ✅ never exceed viewport height */
  max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* On mobile, account for your bottom bar extra space */
@media (max-width: 640px){
  .modal-card{
    max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 70px);
  }
}

/* Header */
.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line2);
  flex: 0 0 auto;
}

.modal-title{
  font-size: 16px;
  font-weight: 900;
  color: rgba(11,18,32,.92);
}

.modal-close{
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 12px;
  cursor:pointer;
}
.modal-close:active{ opacity:.92; }

/* ✅ NEW: scroll container for tall content
   Wrap your form/content in <div class="modal-body">...</div>
*/
.modal-body{
  flex: 1 1 auto;
  overflow:auto;
  -webkit-overflow-scrolling: touch;

  /* optional: nicer spacing if your content hugs edges */
  padding-right: 2px;
}

/* Actions (sticky bottom inside card via flex layout) */
.modal-actions{
  display:grid;
  gap: 10px;
  margin-top: 10px;
  flex: 0 0 auto;
}


/* =========================================================
   Client bits
   ========================================================= */

.client-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.client-name{
  font-size: 18px;
  font-weight: 900;
  color: rgba(11,18,32,.95);
  letter-spacing:-0.01em;
}
.client-meta{
  margin-top: 8px;
  display:grid;
  gap:6px;
  color: var(--muted);
  font-size: 13px;
}
