/* Password page for protected case studies (functions/_middleware.js),
   September 29. A compact card over a heavily softened MiPortal poster,
   after Mobbin references (Synthesia, Luma, Heidi): logo, one line of
   context, the field, one full-width action. The field's focus is its own
   stroke (no outer ring), using the neutral focus token #626b77. */
@font-face { font-family: "Google Sans Flex"; src: url("/assets/fonts/google-sans-flex/GoogleSansFlex-Variable.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4/SourceSerif4-Variable-latin.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --ink: #0d1524;
  --body: #626b77;
  --line: #d9dee5;
  --focus: #626b77;
  --danger: #b42318;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #ffffff; color: var(--ink); }
body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  font-family: "Google Sans Flex", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The case study's own opening poster, blurred almost to white. */
.gate-field {
  position: fixed;
  inset: -80px;
  z-index: 0;
  background: #ffffff url("/assets/product-shots/miportal/case-study/showcase/film-poster-wide-v8.jpg") center / cover no-repeat;
  filter: blur(56px) saturate(1.15);
  opacity: .5;
  pointer-events: none;
}

.gate { position: relative; z-index: 1; width: 100%; max-width: 380px; }
.gate-card {
  padding: 32px 28px 28px;
  border: 1px solid rgb(13 21 36 / .08);
  border-radius: 24px;
  background: rgb(255 255 255 / .86);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
          backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 1px 2px rgb(13 21 36 / .04), 0 24px 48px -24px rgb(13 21 36 / .18);
}
.gate-logo { display: block; height: 28px; width: auto; margin: 0 0 28px; }
h1 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.gate-lead { margin: 10px 0 0; color: var(--body); font-size: 15px; line-height: 1.5; text-wrap: pretty; }

.gate-form { margin-top: 24px; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; line-height: 1.3; }

/* The wrapper draws the stroke, so the reveal button sits inside the field
   and focus thickens the field's own border instead of adding a ring. */
.gate-input {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 0 0 0 var(--focus);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.gate-input:hover { border-color: #b9c0ca; }
.gate-input:focus-within { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.gate-input.is-invalid { border-color: var(--danger); }
.gate-input.is-invalid:focus-within { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.gate-input input {
  flex: 1;
  align-self: stretch;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming the field. */
  line-height: 20px;
  letter-spacing: .01em;
  outline: none;
  -webkit-appearance: none;
          appearance: none;
}
/* Mobile, September 30: Safari drew the masked dots off centre in the
   brand face. Masked text uses the system face, whose bullet sits on the
   centre line; shown text keeps the brand face. */
.gate-input input[type="password"] { font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif; letter-spacing: .12em; }
.gate-input input::-ms-reveal { display: none; }
.gate-input input::-webkit-credentials-auto-fill-button { margin-right: 4px; }

.gate-reveal {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--body);
  cursor: pointer;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.gate-reveal[hidden] { display: none; }
.gate-reveal:hover { color: var(--ink); background: #f3f5f8; }
.gate-reveal:focus-visible { outline: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--focus); }
.gate-eye { width: 18px; height: 18px; fill: currentColor; grid-area: 1 / 1; transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }
.gate-eye--hide { opacity: 0; transform: scale(.8); }
.gate-reveal[aria-pressed="true"] .gate-eye--show { opacity: 0; transform: scale(.8); }
.gate-reveal[aria-pressed="true"] .gate-eye--hide { opacity: 1; transform: none; }

.gate-error { display: flex; gap: 6px; margin: 8px 0 0; color: var(--danger); font-size: 14px; line-height: 1.45; }

.gate-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  margin-top: 16px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.gate-submit:hover { background: #26303f; }
.gate-submit:active { transform: scale(.985); }
.gate-submit:focus-visible { outline: none; box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--focus); }
.gate-submit .btn-arc { display: none; }
.gate-submit.is-loading { cursor: progress; background: #26303f; }
.gate-submit.is-loading .btn-arc { display: block; }

.gate-help { margin: 20px 0 0; color: var(--body); font-size: 14px; line-height: 1.5; text-align: center; }
.gate-help a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: text-decoration-color 160ms var(--ease-out); }
.gate-help a:hover { text-decoration-color: currentColor; }
.gate-help a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

@media (max-width: 420px) {
  .gate-card { padding: 28px 20px 20px; border-radius: 20px; }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-input, .gate-reveal, .gate-eye, .gate-submit, .gate-help a { transition: none; }
  .gate-submit:active { transform: none; }
}
