/* OPN sign-in screens. Elite look, matching the dashboard's sign-in (approved mock 2026-10-07).
   The Academy identity is added in Phase 7A as a .theme-academy override of these tokens. */
:root {
  --bg-a: #0A2B28; --bg-b: #112F2B; --bg-c: #0C2623;
  --accent: #2FD6B3; --accent-deep: #1C9C85; --on-accent: #062A26;
  --text: #F0FFFD; --muted: rgba(240, 255, 253, .64); --line: rgba(255, 255, 255, .12);
  --field: rgba(255, 255, 255, .06); --card: rgba(9, 40, 36, .78);
  --danger: #ff8a96; --danger-bg: rgba(220, 53, 69, .15); --ok-bg: rgba(47, 214, 179, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text);
  background: radial-gradient(1200px 800px at 70% 20%, rgba(47, 214, 179, .08), transparent 60%),
              linear-gradient(135deg, var(--bg-a), var(--bg-b) 45%, var(--bg-c));
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px;
}
.backdrop { position: fixed; inset: 0; background: url("/images/login-bg.png") right center / contain no-repeat; opacity: .6; pointer-events: none; }
@media (max-width: 768px) { .backdrop { opacity: .35; background-size: cover; } }
.card {
  position: relative; width: 100%; max-width: 420px; padding: 36px 32px 28px; border-radius: 20px;
  background: var(--card); border: 1px solid rgba(255, 255, 255, .06);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 15px 40px rgba(0, 0, 0, .55);
}
@media (max-width: 480px) { .card { padding: 28px 20px 22px; } }
.card.centred { text-align: center; }
/* The OPN mark, centred on every screen. A 1056px source, so it stays sharp on 3x phone screens.
   The ::after is the same mark used as a mask, for the band of OPN aqua that sweeps across it on arrival. */
.logo { position: relative; display: block; width: fit-content; margin: 0 auto 28px; line-height: 0; }
.logo img { display: block; height: 34px; width: auto; }
.logo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(105, 223, 201, 1) 50%, transparent 65%) 115% 0 / 250% 100% no-repeat;
  -webkit-mask: url("/images/opn-mark-white.webp") center / contain no-repeat; mask: url("/images/opn-mark-white.webp") center / contain no-repeat;
}
.card.centred .logo { margin-bottom: 22px; }
h1 { font-family: "SUSE", "Poppins", sans-serif; font-weight: 600; font-size: 26px; margin: 0 0 4px; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; line-height: 1.5; }
label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; color: var(--muted); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-row a { font-size: 13px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); color: var(--text);
  font: inherit; font-size: 15px; padding: 12px 16px; margin: 0 0 16px; outline: none;
}
input:focus { border-color: rgba(47, 214, 179, .6); box-shadow: 0 0 0 4px rgba(47, 214, 179, .12); }
/* Browsers repaint autofilled fields white; keep them dark so the text stays readable. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #1a3a35 inset; transition: background-color 9999s ease-out 0s;
}
input.code { letter-spacing: .4em; font-size: 22px; text-align: center; }
.check { display: flex; align-items: center; gap: 10px; margin: 2px 0 22px; font-size: 13px; color: var(--muted); font-weight: 400; cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .04); display: grid; place-content: center; cursor: pointer;
}
.check input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); opacity: 0; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; border-radius: 12px; border: none;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, rgba(47, 214, 179, .9), rgba(28, 156, 133, .95)); color: var(--on-accent); }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid rgba(255, 255, 255, .18); }
.btn.secondary:hover { background: rgba(255, 255, 255, .04); }
.stack { display: grid; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.notice.error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220, 53, 69, .3); }
.notice.ok { background: var(--ok-bg); color: var(--text); border: 1px solid rgba(47, 214, 179, .3); }
.foot { margin: 22px 0 0; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.5; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list .btn { justify-content: space-between; height: auto; min-height: 50px; padding: 10px 14px; font-weight: 500; text-align: left; }
.list small { color: var(--muted); font-weight: 400; font-size: 12px; }
.who { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 18px; font-size: 14px; }
.who small { display: block; color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: 224px; height: 224px; margin: 0 auto 14px; }
.qr svg { width: 200px; height: 200px; display: block; }
.manual { font-size: 12px; color: var(--muted); text-align: center; margin: 0 0 20px; line-height: 1.6; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text); letter-spacing: .06em; }
.codes { list-style: none; padding: 14px; margin: 0 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: var(--field); border: 1px solid var(--line); border-radius: 12px; text-align: center; font-size: 15px; }
details.recovery { margin-top: 18px; }
details.recovery summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 500; text-align: center; list-style: none; }
details.recovery summary::-webkit-details-marker { display: none; }
details.recovery[open] summary { margin-bottom: 14px; }
.spaced { margin-top: 10px; }
.spaced-bottom { margin-bottom: 18px; }

/* Password show/hide (x-password-field), matching the dashboard sign-in. */
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.pwd-toggle { position: absolute; top: 0; right: 4px; height: 50px; width: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 10px; }
.pwd-toggle:hover { color: var(--accent); }
.pwd-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pwd-toggle .eye-closed, .pwd-toggle[aria-pressed="true"] .eye-open { display: none; }
.pwd-toggle[aria-pressed="true"] .eye-closed { display: block; }
.copyright { position: relative; text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0 0; }

/* Passkeys on the account page. */
h2 { font-family: "SUSE", "Poppins", sans-serif; font-weight: 600; font-size: 17px; margin: 22px 0 10px; }
.who.passkey { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
button.link { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px; font-weight: 500; color: var(--accent); cursor: pointer; }
button.link:hover { text-decoration: underline; }

/* Grey hints in empty fields (dashboard sign-in parity). */
input::placeholder { color: var(--muted); opacity: .6; }

/* Provider logos in sign-in buttons. */
.btn .brand-icon { flex: none; }

/* Demo accounts on the sign-in page (test environments only). */
.demo-panel { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.demo-panel h2 { font-family: 'SUSE', sans-serif; font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.demo-panel .hint { color: var(--muted); font-size: 12px; margin: 0 0 12px; line-height: 1.5; }
.demo-club + .demo-club { margin-top: 8px; }
.demo-club summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 8px 0; color: var(--accent); }
.demo-club[open] summary { margin-bottom: 6px; }
.demo-persona { flex-direction: column; align-items: flex-start; gap: 6px; }
.demo-who { display: flex; flex-direction: column; gap: 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { font-size: 11px; font-weight: 500; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--ok-bg); color: var(--accent); }

/* Entrance, on the first sign-in page of a visit (the layout adds .intro). One moment: the artwork
   settles, the card rises, the mark comes into focus, the form follows line by line, then a band of
   OPN aqua passes across the mark. No overshoot: everything decelerates into place.
   Off for people who ask for less motion. */
:root { --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-out-expo: cubic-bezier(.16, 1, .3, 1); }
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform .15s var(--ease-out), filter .2s ease, background-color .2s ease; }
  .btn:active { transform: scale(.98); }
  .btn.primary:hover { filter: brightness(1.06); }
  input[type=email], input[type=password], input[type=text], input[type=tel] { transition: border-color .2s ease, box-shadow .2s ease; }

  .intro .backdrop { animation: opn-backdrop 2.4s var(--ease-out) both; }
  .intro .card { animation: opn-rise .9s var(--ease-out-expo) .05s both; }
  .intro .logo { animation: opn-focus 1s var(--ease-out) .2s both; }
  .intro .card > :not(.logo):not(form), .intro .card form > * { animation: opn-fade-up .6s var(--ease-out) both; }
  .intro .card > :nth-child(2) { animation-delay: .45s; }
  .intro .card > :nth-child(3) { animation-delay: .51s; }
  .intro .card > :nth-child(n+4) { animation-delay: .57s; }
  .intro .card form > :nth-child(1) { animation-delay: .57s; }
  .intro .card form > :nth-child(2) { animation-delay: .63s; }
  .intro .card form > :nth-child(3) { animation-delay: .69s; }
  .intro .card form > :nth-child(4) { animation-delay: .75s; }
  .intro .card form > :nth-child(5) { animation-delay: .81s; }
  .intro .card form > :nth-child(n+6) { animation-delay: .87s; }
  .intro .copyright { animation: opn-fade-up .6s var(--ease-out) 1s both; }
  .intro .logo::after { animation: opn-sheen 1.6s cubic-bezier(.45, 0, .25, 1) 1.1s both; }
}
@keyframes opn-backdrop { from { opacity: 0; transform: scale(1.04); } }
@keyframes opn-rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes opn-focus { from { opacity: 0; filter: blur(10px); transform: translateY(6px) scale(.94); } }
@keyframes opn-fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes opn-sheen { 0% { opacity: 1; background-position: 115% 0; } 80% { opacity: 1; } 100% { opacity: 0; background-position: -15% 0; } }
