/* gate.css — Anchor House · the ONE shared "authentication boundary" gate style.
 * Loaded identically by index.html (landing gate), operations.html (/operations + /vessels),
 * and auth.html (Clerk sign-in). Only the contextual title text differs — no per-page drift
 * in border, padding, colours, button, close, or field.
 *
 * Principles: gold is a boundary/reward, used restrained; the machined gold frame does the
 * depth work so the panel stays FLAT (no gradient); brass hardware, warm archival paper.
 */
:root{
  --ahg-gold:#C9A96A;          /* machined gold — the frame */
  --ahg-brass:#AB884B;         /* darker, desaturated, matte — old-brass hardware */
  --ahg-brass-hover:#BE9A5A;   /* hover: a shade LIGHTER brass (derived from base, not bright gold) */
  --ahg-brass-active:#927338;  /* active: a shade DARKER brass */
  --ahg-paper:#FCFBF8;         /* warm archival white — the body */
  --ahg-navy:#1F2A44;
  --ahg-slate:#D7D9DD;         /* inactive field border */
  --ahg-ink:#5a6577;           /* label ink — AA-contrast on warm paper */
}

/* ---- Backdrop — near-opaque navy, blurred. Identical for the wall (operations) and the
   dismissible modal (index). Two show-triggers, harmless where unused. ---- */
/* Whisper gradient was TRIED here and DROPPED: on this dark navy the eye is sensitive to small
   luminance steps, so even a minimal radial read as a visible vignette. Per the discipline
   ("when in doubt, keep it flat"), the dimmed area stays flat. */
.ah-gate-backdrop{position:fixed;inset:0;z-index:100000;background:rgba(20,28,48,.985);
  backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);
  display:none;align-items:center;justify-content:center;padding:24px;animation:ahgFade .2s ease;}
@keyframes ahgFade{from{opacity:0}to{opacity:1}}
html.ah-locked .ah-gate-backdrop{display:flex;}     /* operations wall */
.ah-gate-backdrop.open{display:flex;}               /* index modal */
html.ah-locked,html.ah-locked body{overflow:hidden !important;}

/* ---- Card — the gold frame IS the object; flat navy panel, tight short shadow, clipped corners.
   Inset white hairline reads as a machined bevel. ---- */
.ah-gate-modal{position:relative;width:100%;max-width:400px;box-sizing:border-box;
  background:var(--ahg-navy);border-radius:14px;overflow:hidden;
  border:2px solid var(--ahg-gold);
  box-shadow:0 0 0 1px rgba(255,255,255,.04) inset, 0 10px 28px rgba(0,0,0,.18);
  animation:ahgIn .18s ease-out;}
/* Restrained fade + gentle scale-in on open (no bounce). */
@keyframes ahgIn{from{opacity:0;transform:scale(.98)}to{opacity:1;transform:none}}

/* ---- Header — flat navy; lockup, title, subtitle. ---- */
.ah-gate-header{background:var(--ahg-navy);padding:24px 24px 16px;position:relative;}
/* 24px below the lockup (whose tagline is "ESTATE OPERATIONS INFRASTRUCTURE") for breathing room. */
.ah-gate-lockup-link{display:inline-block;margin:0 0 24px;line-height:0;transition:opacity .15s;-webkit-tap-highlight-color:transparent;}
.ah-gate-lockup-link:hover{opacity:.85;}
.ah-gate-lockup{width:216px;height:auto;display:block;}
.ah-gate-title{font-family:'Playfair Display',serif;font-size:clamp(15px,4.3vw,19px);font-weight:600;color:#fff;line-height:1.2;white-space:nowrap;}
/* Wider tracking + solid gold (AA on navy) for a more premium, legible subtitle. */
.ah-gate-sub{font-size:10px;font-weight:500;letter-spacing:.24em;text-transform:uppercase;color:var(--ahg-gold);margin-top:8px;}

/* ---- Quiet close — 34px visual ring that recedes, but a ≥44×44 invisible tap target for touch.
   The button itself is 44×44 (transparent); the visible ring is a centred 34px ::before. ---- */
.ah-gate-close{position:absolute;top:6px;right:6px;width:46px;height:46px;padding:0;border:none;
  background:transparent;color:rgba(255,255,255,.6);font-size:16px;font-weight:300;line-height:1;
  display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:.7;
  -webkit-tap-highlight-color:transparent;transition:opacity .15s,color .15s;}
.ah-gate-close::before{content:"";position:absolute;width:34px;height:34px;border-radius:50%;
  border:1px solid rgba(255,255,255,.14);transition:border-color .15s;pointer-events:none;}
.ah-gate-close:hover{opacity:1;color:#fff;}
.ah-gate-close:hover::before{border-color:rgba(255,255,255,.32);}
.ah-gate-close:focus-visible{outline:2px solid rgba(255,255,255,.75);outline-offset:2px;opacity:1;}

/* ---- Body — warm archival white, generous margins (credential-folder feel). ---- */
.ah-gate-body{background:var(--ahg-paper);padding:24px;}

/* Engraved, wide-tracked credential label. */
.ah-gate-cred-label{font-size:9px;font-weight:600;letter-spacing:.22em;text-transform:uppercase;
  color:var(--ahg-ink);margin-bottom:10px;}

/* Per-field labels (EMAIL ADDRESS / PASSWORD), engraved to match. */
.ah-gate-field-label{display:block;font-size:9px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;
  color:var(--ahg-ink);margin-bottom:8px;}
.ah-gate-field-label.two{margin-top:16px;}

/* Email field — full-width, normal text (own keyboard). Same 40px crisp height, slate at rest,
   gold confirms focus. */
/* font-size MUST be >= 16px — iOS Safari auto-zooms the whole page when a focused input is
   under 16px and never zooms back (this was the "loads zoomed in" bug: the gate focuses this
   field on open). 16px stops the zoom; the 40px height keeps the crisp proportion. */
.ah-gate-email{width:100%;height:40px;box-sizing:border-box;padding:0 14px;
  font-family:'Jost',sans-serif;font-size:16px;font-weight:300;color:var(--ahg-navy);background:#fff;
  border:1px solid var(--ahg-slate);border-radius:3px;outline:none;transition:border-color .16s,box-shadow .16s;}
.ah-gate-email::placeholder{color:#c4c8ce;letter-spacing:0;}
.ah-gate-email:focus{border-color:var(--ahg-navy);box-shadow:inset 0 0 0 2px rgba(201,169,106,.20);}
.ah-gate-email.error{border-color:#b91c1c;animation:ahgShake .4s ease;}

/* ---- Field row — password field + brass ENTER, matched 40px height (8px grid),
   crisp/administrative, not chunky. ---- */
.ah-gate-row{display:flex;gap:8px;width:100%;min-width:0;}
.ah-gate-input{flex:1;min-width:0;height:40px;box-sizing:border-box;padding:0 14px;
  font-family:'Jost',sans-serif;font-size:17px;font-weight:300;letter-spacing:5px;text-align:left;
  color:var(--ahg-navy);background:#fff;border:1px solid var(--ahg-slate);border-radius:3px;outline:none;
  transition:border-color .16s,box-shadow .16s;}
.ah-gate-input::placeholder{letter-spacing:5px;color:#c4c8ce;}
/* Gold CONFIRMS focus via a faint inner glow — it does not DEFINE the resting field. */
.ah-gate-input:focus{border-color:var(--ahg-navy);box-shadow:inset 0 0 0 2px rgba(201,169,106,.20);}
.ah-gate-input.error{border-color:#b91c1c;animation:ahgShake .4s ease;}
@keyframes ahgShake{0%,100%{transform:translateX(0)}20%{transform:translateX(-5px)}40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}

/* ---- Brass ENTER — matte old-brass hardware, dark engraved text, matched height. ---- */
.ah-gate-submit{flex:0 0 auto;height:40px;padding:0 22px;border:none;border-radius:3px;
  font-family:'Jost',sans-serif;font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:#241d10;background:var(--ahg-brass);cursor:pointer;transition:background .15s;white-space:nowrap;}
.ah-gate-submit:hover{background:var(--ahg-brass-hover);}   /* lighter brass */
.ah-gate-submit:active{background:var(--ahg-brass-active);} /* darker brass */

/* Keyboard focus ring — visible for keyboard users (in addition to the gold focus-confirm glow),
   suppressed for mouse/touch via :focus-visible. Accessible, not decorative. */
.ah-gate-email:focus-visible,.ah-gate-input:focus-visible,.ah-gate-submit:focus-visible{
  outline:2px solid var(--ahg-gold);outline-offset:2px;}

.ah-gate-error{font-size:12px;color:#b91c1c;margin-top:10px;min-height:16px;letter-spacing:.02em;}

/* Respect reduced-motion — skip the open animation entirely. */
@media (prefers-reduced-motion: reduce){
  .ah-gate-modal,.ah-gate-backdrop{animation:none !important;}
  .ah-gate-email.error,.ah-gate-input.error{animation:none !important;}
}

@media (max-width:768px){
  .ah-gate-backdrop{padding:16px;align-items:center;}
  .ah-gate-header{padding:22px 20px 14px;}
  .ah-gate-body{padding:20px;}
  .ah-gate-lockup{width:196px;}
}
