/* Sign-in, approval and Access screens. Separate floating panels on a deep charcoal background. */
.ew-auth, .ew-modal {
  --ew-bg: #171918; --ew-hi: #343835; --ew-lo: #272b28; --ew-ink: #f3eee3; --ew-muted: #b7b2a6; --ew-dim: #8f8b81;
  --ew-line: #4a4f4b; --ew-field: #1f2220; --ew-yellow: #ffb51b; --ew-yellow-hi: #ffc443; --ew-bad: #f4a79e; --ew-good: #7fd3a4;
  font: 15px/1.5 "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ew-ink); -webkit-font-smoothing: antialiased;
}
body.ew-locked { overflow: hidden; }
body.ew-locked > :not(.ew-auth):not(.ew-demo):not(script) { display: none !important; }
.ew-auth { position: fixed; inset: 0; z-index: 90; overflow-y: auto; background: var(--ew-bg); display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.ew-auth *, .ew-modal * { box-sizing: border-box; }

/* Big panel: branding and drawing on the left, the form panel on the right */
.ew-frame { position: relative; width: min(1180px, 100%); min-height: min(760px, calc(100dvh - 48px)); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 520px);
  align-items: center; gap: 40px; padding: 56px 56px 56px 60px; border-radius: 24px; overflow: hidden;
  background: linear-gradient(165deg, #2f3330 0%, #232624 55%, #1d201e 100%);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / .75), inset 0 1px 0 rgb(255 255 255 / .06); }
.ew-brand { position: relative; align-self: stretch; display: grid; grid-template-rows: auto 1fr; gap: 24px; min-height: 100%; }
.ew-mark { display: flex; align-items: center; gap: 18px; font-size: 22px; font-weight: 500; letter-spacing: .005em; }
.ew-mark img { height: 62px; width: auto; display: block; }
.ew-rule { width: 1.5px; height: 46px; background: rgb(243 238 227 / .55); }
.ew-pitch { align-self: start; padding-top: 7vh; position: relative; z-index: 1; }
.ew-head { margin: 0; font-size: clamp(44px, 5.2vw, 68px); line-height: 1.04; font-weight: 700; letter-spacing: -.025em; }
.ew-bar { display: block; width: 64px; height: 5px; border-radius: 3px; background: var(--ew-yellow); margin: 26px 0 20px; }
.ew-tag { margin: 0; font-size: 24px; line-height: 1.35; color: #e4dfd3; max-width: 20ch; }
.ew-art { position: absolute; left: -60px; right: -40px; bottom: -56px; width: calc(100% + 100px); height: auto; opacity: .5; pointer-events: none;
  fill: none; stroke: #e9e3d4; stroke-width: 1; stroke-linejoin: round; stroke-linecap: round; }

/* Floating form panel */
.ew-panel { position: relative; z-index: 1; padding: 44px 46px 38px; border-radius: 22px;
  background: linear-gradient(170deg, var(--ew-hi) 0%, var(--ew-lo) 100%);
  border: 1px solid rgb(255 255 255 / .06); box-shadow: 0 30px 60px -24px rgb(0 0 0 / .7), 0 2px 6px rgb(0 0 0 / .25), inset 0 1px 0 rgb(255 255 255 / .09); }
.ew-panel form, .ew-status { display: grid; gap: 14px; }
.ew-panel h1 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; outline: none; }
.ew-panel h1.ew-caps { font-size: 22px; letter-spacing: .02em; text-transform: uppercase; font-weight: 600; padding-bottom: 12px; position: relative; margin-bottom: 4px; }
.ew-panel h1.ew-caps::after { content: ""; position: absolute; left: 0; bottom: 0; width: 46px; height: 4px; border-radius: 2px; background: var(--ew-yellow); }
.ew-sub { margin: -4px 0 8px; color: #dcd6c9; font-size: 17px; }
.ew-field { display: grid; gap: 7px; }
.ew-field label { font-size: 15px; font-weight: 600; color: var(--ew-ink); }
.ew-field input { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--ew-line); background: var(--ew-field);
  color: var(--ew-ink); font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.ew-field input:hover { border-color: #636963; }
.ew-field input:focus-visible { outline: none; border-color: var(--ew-yellow); box-shadow: 0 0 0 3px rgb(255 181 27 / .25); }
.ew-field input:-webkit-autofill { -webkit-text-fill-color: var(--ew-ink); -webkit-box-shadow: 0 0 0 40px var(--ew-field) inset; caret-color: var(--ew-ink); }
.ew-pw { position: relative; }
.ew-pw input { padding-right: 52px; }
.ew-eye { position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 44px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ew-muted); cursor: pointer; }
.ew-eye svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ew-eye[aria-pressed="true"] { color: var(--ew-yellow); }
.ew-eye:hover { color: var(--ew-ink); }
.ew-eye:focus-visible, .ew-link:focus-visible, .ew-btn:focus-visible, .ew-x:focus-visible, .ew-tabs button:focus-visible { outline: 2px solid var(--ew-yellow); outline-offset: 2px; }
.ew-hint { margin: -8px 0 0; font-size: 13px; color: var(--ew-dim); }
.ew-link { background: none; border: 0; padding: 0; color: var(--ew-yellow); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: 4px; }
.ew-link:hover { color: var(--ew-yellow-hi); }
.ew-forgot { justify-self: end; font-size: 15px; font-weight: 500; min-height: 32px; margin-top: -4px; }
.ew-msg { margin: 0; min-height: 0; font-size: 14.5px; color: var(--ew-bad); }
.ew-msg:empty { display: none; }
.ew-msg.good { color: var(--ew-good); }

.ew-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.ew-btn:active:not(:disabled) { transform: translateY(1px); }
.ew-btn:disabled { cursor: default; opacity: .65; }
.ew-primary { background: var(--ew-yellow); color: #1b1b1b; box-shadow: 0 8px 18px -10px rgb(255 181 27 / .7); }
.ew-primary:hover:not(:disabled) { background: var(--ew-yellow-hi); }
.ew-ghost { background: transparent; color: var(--ew-ink); border-color: rgb(243 238 227 / .7); }
.ew-ghost:hover:not(:disabled) { background: rgb(255 255 255 / .05); }
.ew-google { background: var(--ew-field); color: var(--ew-ink); border-color: var(--ew-line); font-weight: 600; font-size: 16px; }
.ew-google:hover:not(:disabled) { border-color: #6b716b; }
.ew-google svg { width: 20px; height: 20px; }
.ew-btn.busy { color: transparent !important; opacity: 1; }
.ew-btn.busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-color: #1b1b1b #1b1b1b transparent; animation: ewspin .7s linear infinite; }
.ew-ghost.busy::after, .ew-google.busy::after { border-color: var(--ew-ink) var(--ew-ink) transparent; }
.ew-or { display: flex; align-items: center; gap: 14px; color: var(--ew-muted); font-size: 15px; margin: 2px 0; }
.ew-or::before, .ew-or::after { content: ""; flex: 1; height: 1px; background: rgb(243 238 227 / .4); }
.ew-foot { margin: 4px 0 0; text-align: center; font-size: 17px; }
.ew-fine { margin: -4px 0 0; text-align: center; font-size: 14.5px; color: #d8d2c5; }

/* Status screens */
.ew-center { text-align: center; }
.ew-status { justify-items: center; }
.ew-status p { margin: 0; color: #dcd6c9; max-width: 38ch; }
.ew-status .ew-note { font-size: 14px; color: var(--ew-muted); }
.ew-status .ew-field { width: 100%; text-align: left; }
.ew-icon { width: 76px; height: 76px; fill: none; stroke: var(--ew-yellow); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.ew-panel.ew-center h1 { font-size: 32px; }
.ew-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: 100%; margin-top: 6px; }
.ew-row .ew-btn { flex: 1 1 150px; }
.ew-who { font-size: 13.5px; color: var(--ew-dim) !important; }
.ew-who b { color: var(--ew-muted); font-weight: 600; }
.ew-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgb(243 238 227 / .2); border-top-color: var(--ew-yellow); animation: ewspin .8s linear infinite; display: block; margin: 24px auto; }
@keyframes ewspin { to { rotate: 360deg; } }

/* Phones and narrow windows: the form comes first, branding shrinks to a header */
@media (max-width: 900px) {
  .ew-auth { place-items: start center; padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
  .ew-frame { grid-template-columns: 1fr; min-height: 0; gap: 18px; padding: 0; background: none; box-shadow: none; border-radius: 0; overflow: visible; width: min(520px, 100%); }
  .ew-brand { display: block; min-height: 0; }
  .ew-mark { gap: 12px; font-size: 16px; justify-content: center; }
  .ew-mark img { height: 42px; }
  .ew-rule { height: 30px; }
  .ew-pitch, .ew-art { display: none; }
  .ew-panel { padding: 28px 22px 26px; border-radius: 18px; }
  .ew-panel h1 { font-size: 30px; }
  .ew-panel.ew-center h1 { font-size: 26px; }
  .ew-sub { font-size: 16px; }
  .ew-foot { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ew-spin, .ew-btn.busy::after { animation-duration: 2s; } }

/* Local test-mode banner */
.ew-demo { position: fixed; z-index: 100; left: 50%; bottom: 10px; translate: -50% 0; max-width: calc(100% - 20px); padding: 7px 14px; border-radius: 999px;
  background: #ffb51b; color: #1b1b1b; font: 600 12.5px/1.3 "Archivo", system-ui, sans-serif; box-shadow: 0 6px 18px rgb(0 0 0 / .4); text-align: center; pointer-events: none; }

/* Access dashboard */
.ew-modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: start center; overflow-y: auto; background: rgb(10 11 10 / .72); backdrop-filter: blur(3px);
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.ew-dash { width: min(760px, 100%); margin-top: 4vh; padding: 28px 28px 24px; border-radius: 20px; background: linear-gradient(170deg, var(--ew-hi), var(--ew-lo));
  border: 1px solid rgb(255 255 255 / .06); box-shadow: 0 30px 70px -20px rgb(0 0 0 / .8), inset 0 1px 0 rgb(255 255 255 / .09); display: grid; gap: 14px; }
.ew-dash header { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.ew-dash h1 { margin: 0 0 4px; font-size: 28px; font-weight: 700; outline: none; }
.ew-dash .ew-sub { margin: 0; font-size: 15px; color: var(--ew-muted); }
.ew-x { width: 44px; height: 44px; flex: none; border-radius: 10px; border: 1px solid var(--ew-line); background: var(--ew-field); color: var(--ew-ink); font-size: 24px; line-height: 1; cursor: pointer; }
.ew-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--ew-field); width: fit-content; }
.ew-tabs button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: none; color: var(--ew-muted); font: inherit; font-weight: 600; cursor: pointer; }
.ew-tabs button[aria-selected="true"] { background: var(--ew-hi); color: var(--ew-ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / .08); }
.ew-list { display: grid; }
.ew-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 14px 0; border-top: 1px solid rgb(255 255 255 / .08); align-items: center; }
.ew-id b { display: block; font-size: 16px; font-weight: 600; }
.ew-id span { display: block; font-size: 14px; color: var(--ew-muted); overflow-wrap: anywhere; }
.ew-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--ew-dim); }
.ew-acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.ew-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgb(255 255 255 / .08); color: var(--ew-ink); }
.ew-chip.s-approved { background: rgb(127 211 164 / .16); color: var(--ew-good); }
.ew-chip.s-pending { background: rgb(255 181 27 / .16); color: var(--ew-yellow); }
.ew-chip.s-rejected, .ew-chip.s-suspended { background: rgb(244 167 158 / .16); color: var(--ew-bad); }
.ew-chip.s-admin { background: rgb(243 238 227 / .12); }
.ew-v::before { content: "✕ "; color: var(--ew-bad); }
.ew-v.ok::before { content: "✓ "; color: var(--ew-good); }
.ew-btn.ew-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.ew-btn.armed { background: #f0857a; border-color: #f0857a; color: #1b1b1b; }
.ew-you { font-size: 13px; color: var(--ew-dim); }
.ew-empty { margin: 0; padding: 22px 0 10px; color: var(--ew-muted); border-top: 1px solid rgb(255 255 255 / .08); }
.ew-dash .ew-msg { margin: 0; }
@media (max-width: 560px) {
  .ew-dash { padding: 22px 18px 18px; margin-top: 0; }
  .ew-item { grid-template-columns: 1fr; }
  .ew-acts { grid-column: 1; grid-row: auto; justify-content: start; }
}

/* Account buttons in the page header */
.fb-acct { display: flex; gap: 8px; }
.fb-acct .btn { min-height: 38px !important; padding: 0 12px !important; font-size: 13px !important; position: relative; }
.fb-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #ffb51b; color: #1b1b1b; font-size: 12px; font-weight: 700; }
