/* ELMED additions on top of Sophia's site.css + refresh.css.
   Her package was a static preview, so it had no real forms, signed-in state or
   error messages. Everything those need lives here, plus small-phone fixes. */

/* ── Header: signed-in state, phone-only menu items ───────────────────────── */
.nav-mobile-only{display:none}
.nav-links>a[aria-current="page"]{color:var(--teal)}
.nav-cart{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:10px;color:var(--ink)}
.nav-cart:hover{background:var(--pale);color:var(--teal)}
.nav-cart .icon{width:22px;height:22px}
.cart-badge{position:absolute;top:4px;right:2px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:#c2410c;color:#fff;font-size:10px;font-weight:700;line-height:17px;text-align:center}
.cart-badge.hidden{display:none}
.nav-dash{white-space:nowrap}
.nav-dash:hover{color:var(--teal)}

.admin-session-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:8px 16px;font-size:13px;position:relative;z-index:41}
.admin-session-bar form{margin-left:auto}
.admin-session-bar button{border:0;border-radius:6px;padding:6px 12px;font-size:12px;font-weight:700;min-height:34px}
.admin-session-bar.impersonating{background:#7f1d1d;color:#fecaca}
.admin-session-bar.impersonating button{background:#ef4444;color:#fff}
.admin-session-bar.preview{background:#1e293b;color:#e2e8f0}
.admin-session-bar.preview button{background:#f59e0b;color:#1e293b}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.alert{display:flex;gap:12px;align-items:flex-start;padding:14px 18px;border-radius:10px;font-size:14px;line-height:1.6;margin-bottom:22px;border:1px solid}
.alert .icon{width:20px;height:20px;margin-top:2px}
.alert p{color:inherit}
.alert a{text-decoration:underline;text-underline-offset:3px;font-weight:600}
.alert.error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.alert.success{background:#ecfdf5;border-color:#a7f3d0;color:#065f46}
.alert.info{background:var(--pale);border-color:var(--line);color:var(--ink)}

/* ── Forms (sign in, register, password, contact, investors) ──────────────── */
.auth-section{padding:56px 0 90px}
.auth-card{max-width:560px;margin:0 auto;background:#fff;border:1px solid var(--line);border-radius:22px;padding:40px;box-shadow:var(--shadow)}
.auth-card.wide{max-width:720px}
.auth-card h2{font-size:30px;margin-bottom:10px}
.auth-card>p.lead-sm{font-size:15px;margin-bottom:26px}
.auth-card .btn.block,.contact-form .btn.block{width:100%}
.auth-links{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:22px;font-size:14px}
.auth-links a{color:var(--teal);font-weight:600}
.auth-links a:hover{text-decoration:underline;text-underline-offset:3px}
.field-hint{font-size:12px;color:var(--muted);margin-top:6px}
.field label .req{color:#b42318}
.check-row{display:flex;gap:10px;align-items:flex-start;font-size:13px;color:var(--muted);margin:6px 0 20px}
.check-row input{width:20px;height:20px;min-height:0;margin-top:2px;flex-shrink:0;accent-color:var(--teal)}
.check-row label{font-weight:400;margin:0;font-size:13px}
.check-row a{color:var(--teal);text-decoration:underline}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px #087f7326}
.btn[disabled]{opacity:.7;cursor:progress;transform:none}
.hp-field{position:absolute!important;left:-10000px!important;width:1px;height:1px;overflow:hidden}

.pw-meter{height:6px;border-radius:4px;background:var(--line);overflow:hidden;margin-top:8px}
.pw-meter span{display:block;height:100%;width:0;background:#dc2626;transition:width .25s,background .25s}
.pw-meter-label{font-size:12px;margin-top:5px;color:var(--muted)}

.role-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:8px}
.role-picker button{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:10px;padding:11px 8px;font-size:13px;font-weight:600;min-height:48px;line-height:1.3}
.role-picker button:hover{border-color:var(--teal)}
.role-picker button[aria-pressed="true"]{background:var(--teal);border-color:var(--teal);color:#fff}
.role-more{margin:6px 0 22px}
.role-more select{font-size:14px}

.success-panel{text-align:center;padding:10px 0}
.success-panel .icon-box{margin:0 auto 20px;width:64px;height:64px;background:#e3f5ec}
.success-panel h2{margin-bottom:12px}

/* Contact page details card, investor form */
.contact-card a{color:var(--teal)}
.form-section-title{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:var(--teal);font-weight:700;margin:6px 0 14px}

/* ── Sign in / register layout: form first, photo beside it on wide screens ── */
.auth-hero{background:linear-gradient(125deg,#f0f8f5 0%,#fff 70%);padding:48px 0 88px}
.auth-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:56px;align-items:start}
.auth-layout.single{grid-template-columns:minmax(0,1fr)}
.auth-layout .auth-card{margin:0;width:100%}
.auth-layout.single .auth-card{margin:0 auto}
.auth-title{font-size:clamp(32px,3.4vw,46px);letter-spacing:-.045em;line-height:1.1;margin-bottom:12px}
.auth-card .lead-sm{font-size:15px;line-height:1.7;margin-bottom:26px}
.auth-card .eyebrow{margin-bottom:12px}
.auth-portrait{position:sticky;top:120px}
.auth-portrait img{width:100%;height:100%;object-fit:cover}
.auth-foot{display:flex;align-items:center;gap:8px;font-size:12px;margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}
.auth-foot .icon{width:16px;height:16px;color:var(--teal)}

.pw-wrap{position:relative}
.pw-wrap input{padding-right:76px}
.pw-toggle{position:absolute;right:6px;top:50%;transform:translateY(-50%);border:0;background:transparent;color:var(--teal);font-size:13px;font-weight:700;padding:8px 10px;min-height:40px;border-radius:6px}
.pw-toggle:hover{background:var(--pale)}

.account-type{border:0;padding:0;margin:0 0 18px}
.account-type legend{font-size:12px;font-weight:600;margin-bottom:9px;padding:0}
.segmented{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.segmented button{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left;border:1.5px solid var(--line);background:#fff;color:var(--ink);border-radius:12px;padding:14px 16px;min-height:64px;transition:border-color .2s,background .2s}
.segmented button strong{font-size:14px;line-height:1.3}
.segmented button small{font-size:12px;color:var(--muted);line-height:1.4}
.segmented button:hover{border-color:#8cc5b6}
.segmented button[aria-pressed="true"]{border-color:var(--teal);background:var(--pale);box-shadow:inset 0 0 0 1px var(--teal)}
optgroup{font-weight:700}

@media(max-width:900px){
  .auth-layout{grid-template-columns:minmax(0,1fr);gap:0}
  .auth-portrait{display:none}
  .auth-layout .auth-card{max-width:640px;margin:0 auto}
}
@media(max-width:680px){
  .auth-hero{padding:20px 0 56px}
  .auth-title{font-size:32px}
  .segmented button{padding:12px;min-height:72px}
  .segmented button strong{font-size:13px}
}
@media(max-width:350px){
  .segmented{grid-template-columns:1fr}
}

/* ── Phones ───────────────────────────────────────────────────────────────── */
@media(max-width:900px){
  .nav-links.mobile-open .nav-mobile-only{display:block}
  .nav-links.mobile-open .nav-mobile-only:first-of-type{border-top:1px solid var(--line);margin-top:8px;padding-top:16px}
  .nav-links.mobile-open .nav-mobile-cta{color:var(--teal);font-weight:700}
  .nav-links.mobile-open .nav-signout{color:#b42318}
  .nav-links.mobile-open>a,.nav-links.mobile-open summary{min-height:44px;display:flex;align-items:center}
  .nav-links.mobile-open .nav-panel a{min-height:44px;display:flex;align-items:center}
  .menu-toggle{width:44px;height:44px;align-items:center;justify-content:center}
  .nav-actions{gap:12px}
  .nav-actions>a:not(.btn):not(.nav-cart){min-height:44px;display:inline-flex;align-items:center}
}

@media(max-width:680px){
  /* iOS zooms the page into any field under 16px when it is focused */
  input,select,textarea{font-size:16px}
  .auth-section{padding:32px 0 64px}
  .auth-card{padding:28px 20px;border-radius:18px}
  .auth-card h2{font-size:26px}
  .role-picker{grid-template-columns:repeat(2,1fr)}
  .footer-links{gap:2px}
  .footer-links a{display:block;padding:9px 0;font-size:14px}
  .footer-contact{font-size:13px;padding:6px 0}
  .footer h3{font-size:13px;margin-bottom:8px}
  .mobile-download{padding-bottom:calc(10px + env(safe-area-inset-bottom))}
  .whatsapp.above-tabbar{bottom:calc(80px + env(safe-area-inset-bottom))}
  .announcement{line-height:1.6}
  .cta-band .btn{width:100%}
  .actions .btn{flex:1 1 auto}
  .faq summary{min-height:48px}
  .breadcrumb{flex-wrap:wrap;row-gap:4px}
  .page-portrait figcaption{font-size:11px}
}

@media(max-width:480px){
  .nav-dash{display:none!important}
}

@media(max-width:420px){
  .wrap{width:calc(100% - 32px)}
  .hero h1{font-size:44px}
  .page-hero h1,.page-hero .split h1{font-size:36px}
  .prose h1{font-size:34px}
  h2{font-size:30px}
  .app-section h2{font-size:34px}
  .cta-band h2{font-size:26px}
  .photo-frame{height:340px}
  .split-photo>img{height:300px}
  .brand-word{font-size:20px}
  .brand-word small{font-size:8px;letter-spacing:.18em}
  .brand-mark{width:32px;height:32px}
  .trust-item{padding:14px 6px!important}
  .service-grid{grid-template-columns:1fr}
  .service-card{border-right:0!important;border-bottom:1px solid var(--line)}
  .service-card:last-child{border-bottom:0}
  .phone{width:240px}
  .phone-orbit{width:300px;height:300px}
  .consult-orbit{transform:scale(.9)}
  .hero-note{flex-wrap:wrap;row-gap:8px}
  .mobile-download strong{font-size:11px}
  .mobile-download small{display:none}
}

@media(max-width:350px){
  .hero h1{font-size:38px}
  .page-hero h1,.page-hero .split h1{font-size:31px}
  .role-picker{grid-template-columns:1fr}
}

/* Sign-in and register pages: the sticky "Get started" bar would cover the form */
.no-mobile-bar .mobile-download{display:none!important}
.no-mobile-bar .whatsapp{bottom:16px}
@media(max-width:680px){.no-mobile-bar .footer{padding-bottom:90px}}

/* ── Patient tab bar on public pages (shop, cart, checkout) ───────────────── */
.tabbar{display:none}
.tabbar-sheet[hidden]{display:none}
@media(max-width:1023px){
  .has-tabbar .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:50;background:#fff;border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
  .tabbar a,.tabbar button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:58px;font-size:11px;font-weight:600;color:#6b8278;background:none;border:0;padding:6px 0}
  .tabbar span{font-size:20px;line-height:1}
  .tabbar a[aria-current="page"],.tabbar button[aria-expanded="true"]{color:var(--teal)}
  .tabbar a[aria-current="page"]::after{content:"";width:4px;height:4px;border-radius:50%;background:var(--teal)}
  .has-tabbar .footer{padding-bottom:calc(96px + env(safe-area-inset-bottom))}
  .has-tabbar .whatsapp{bottom:calc(80px + env(safe-area-inset-bottom))}
  .tabbar-sheet{position:fixed;inset:0;z-index:49;background:#0f2a2566;display:flex;align-items:flex-end}
  .tabbar-sheet-panel{width:100%;background:#fff;border-radius:20px 20px 0 0;padding:16px 16px calc(80px + env(safe-area-inset-bottom))}
  .tabbar-sheet-head{display:flex;justify-content:space-between;align-items:center;padding:0 4px 12px;border-bottom:1px solid var(--line);margin-bottom:12px}
  .tabbar-sheet-head button{border:0;background:none;font-size:26px;line-height:1;color:var(--muted);width:44px;height:44px}
  .tabbar-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
  .tabbar-grid a{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 4px;background:var(--pale);border-radius:12px;font-size:12px;font-weight:600;text-align:center}
  .tabbar-grid span{font-size:22px;line-height:1}
  .tabbar-signout{display:block;margin-top:12px;text-align:center;padding:13px;border-radius:12px;background:#fef2f2;color:#b42318;font-weight:700;font-size:14px}
}
