/* =====================================================================
   Staff sign-in and access pages: modern interface layer.
   Loaded after shared.css on the login, laptop sign-in, invitation,
   sign-out and register review pages. Sign-in pages opt into the split
   layout with <body class="auth-page"> and .auth-shell; the other
   access pages keep their top bar and get the refined card and controls.
   ===================================================================== */

html.access-page {
  --paper: #f3f4f0; --card: #fff; --ink: #18302a; --muted: #5a6d64; --line: #e0e5df; --line-strong: #c8d1c9;
  --soft: #f1f4ef; --accent: #22353a; --on: #fff; --focus: #1b89a7; --amber: #ffc15c;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-card: 0 1px 2px #10201a0a, 0 24px 60px -32px #10201a59;
}
@media (prefers-color-scheme: dark) {
  html.access-page {
    --paper: #0f1413; --card: #171d1c; --ink: #e8f0eb; --muted: #a0b0a7; --line: #283230; --line-strong: #3a4743;
    --soft: #1d2423; --accent: #d9ede2; --on: #10201a; --focus: #4fb3d1;
    --shadow-card: inset 0 1px 0 #ffffff08, 0 30px 70px -30px #000d;
  }
}
html.access-page body { letter-spacing: -.006em; }

/* ---------- Shared pieces ---------- */
html.access-page .access-bar {
  background: radial-gradient(60% 140% at 0% 0%, #ffc15c14, transparent 60%), linear-gradient(180deg, #1f2b2d, #192326);
  border-bottom-color: #ffffff10;
}
html.access-page .access-context {
  padding: 4px 11px; border: 1px solid #ffffff1f; border-radius: 999px; background: #ffffff0d;
  font: 600 .74rem/1.4 Instrument, "Segoe UI", sans-serif; letter-spacing: .03em; color: #e3ece6;
}
html.access-page .access-card, html.access-page .review-panel {
  border-color: var(--line); border-radius: 22px; box-shadow: var(--shadow-card);
}
html.access-page .access-card { border-top: 1px solid var(--line); position: relative; overflow: hidden; }
html.access-page .access-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, #ffc15c, #f08a3e 55%, #2f7a5d);
}
html.access-page .access-kicker {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  padding: 5px 11px 5px 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line);
  color: var(--muted); font: 650 .7rem/1.3 Instrument, "Segoe UI", sans-serif; letter-spacing: .07em; text-transform: uppercase;
}
html.access-page .access-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f0a040; box-shadow: 0 0 0 3px #f0a04033; }
html.access-page h1 { letter-spacing: -.045em; }
html.access-page .action {
  border-color: var(--line-strong); border-radius: 12px; min-height: 46px; padding: 10px 18px;
  box-shadow: 0 1px 2px #10201a0d;
  transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
html.access-page .action:hover:enabled, html.access-page a.action:hover { box-shadow: 0 8px 18px -10px #10201a40; transform: translateY(-1px); border-color: #9fb0a3; }
html.access-page .action:active { transform: translateY(0) scale(.985); transition-duration: .06s; }
html.access-page .action.primary {
  color: #fff; border-color: #1f3034; background: linear-gradient(180deg, #334a4f, #22353a);
  box-shadow: inset 0 1px 0 #ffffff1f, 0 10px 22px -12px #1b2a2ecc;
}
html.access-page .action.primary:hover:enabled, html.access-page a.action.primary:hover { background: linear-gradient(180deg, #3b555a, #283e43); border-color: #1f3034; }
@media (prefers-color-scheme: dark) {
  html.access-page .action { background: var(--card); color: var(--ink); }
  html.access-page .action.primary { color: #10201a; border-color: #b9dcc8; background: linear-gradient(180deg, #e0f1e7, #b9dac7); box-shadow: inset 0 1px 0 #ffffff80, 0 10px 22px -12px #000; }
  html.access-page .action.primary:hover:enabled, html.access-page a.action.primary:hover { background: linear-gradient(180deg, #ebf6ef, #c8e3d3); border-color: #c8e3d3; }
}
html.access-page :is(input, select):not([type=checkbox]) { border-color: var(--line-strong); border-radius: 12px; transition: border-color .16s, box-shadow .16s, background .16s; }
html.access-page :is(input, select):not([type=checkbox]):focus { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 20%, transparent); }
html.access-page .access-support { border-top-color: var(--line); }
html.access-page .access-support summary { display: flex; align-items: center; gap: 8px; list-style: none; color: var(--ink); }
html.access-page .access-support summary::-webkit-details-marker { display: none; }
html.access-page .access-support summary::before {
  content: "?"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--soft); border: 1px solid var(--line); font-size: .75rem; font-weight: 700; color: var(--muted);
}
html.access-page .access-support summary::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease); }
html.access-page .access-support[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
html.access-page .access-support p { padding: 12px 14px; border-radius: 12px; background: var(--soft); }
html.access-page .code-line { border-radius: 12px; border: 1px solid var(--line); }
html.access-page .legacy-scroll th { text-transform: uppercase; letter-spacing: .07em; font-size: .68rem; font-weight: 650; }
html.access-page .legacy-confirm { border-radius: 22px; box-shadow: 0 30px 80px -20px #0b1a1466; }
html.access-page .legacy-confirm::backdrop { background: #0b1612b3; backdrop-filter: blur(5px); }

/* Status line under a form: a soft notice, red when it reports an error. */
html.access-page .access-card p[role=status]:not(:empty) {
  margin-top: 18px; padding: 11px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line);
  font-size: .92rem;
}
html.access-page .access-card p.access-error:not(:empty) { background: #fdf0eb; border-color: #efc7b8; }
@media (prefers-color-scheme: dark) { html.access-page .access-card p.access-error:not(:empty) { background: #2c1a15; border-color: #6b3b2e; } }

/* ---------- Sign-in forms ---------- */
html.access-page .access-form { gap: 18px; margin-top: 28px; }
html.access-page .access-form label { gap: 7px; font-size: .86rem; font-weight: 640; }
html.access-page .access-form input:not([type=checkbox]) {
  min-height: 50px; padding: 11px 14px 11px 44px; background-color: var(--card);
  background-repeat: no-repeat; background-position: 14px center; background-size: 18px;
}
html.access-page .access-form input[type=email] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23879890' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E");
}
html.access-page .access-form input[type=password], html.access-page .access-form input[data-revealed] {
  padding-right: 76px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23879890' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='3'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
}
html.access-page .access-form .action.primary[type=submit] { width: 100%; min-height: 50px; font-size: .97rem; }
html.access-page .access-form .access-actions:has(> :nth-child(2):not([hidden])) .action.primary[type=submit] { width: auto; flex: 1; }
html.access-page .access-form .action.primary[type=submit]:disabled { opacity: .85; }
html.access-page .access-form .action.primary[type=submit]:disabled::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: dv-spin .7s linear infinite;
}
@keyframes dv-spin { to { transform: rotate(360deg); } }
/* Show/hide password and Caps Lock hint, added by the page script. */
html.access-page .reveal-field { position: relative; display: block; }
html.access-page .reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font-size: .8rem; font-weight: 650; cursor: pointer;
}
html.access-page .reveal:hover { background: var(--soft); color: var(--ink); }
html.access-page .access-form .caps-hint { display: flex; align-items: center; gap: 6px; color: #9a5a0c; font-size: .78rem; font-weight: 600; }
html.access-page .access-form .caps-hint::before { content: "⇪"; font-size: .9rem; }
@media (prefers-color-scheme: dark) { html.access-page .access-form .caps-hint { color: #f0b85a; } }

/* ---------- Split sign-in layout ---------- */
html.access-page body.auth-page { min-height: 100dvh; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-brand {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: clamp(28px, 4vw, 56px); color: #f2f7f3; background: #141d1f;
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url("/drill-field.webp") 64% 55% / cover no-repeat;
  transform: scale(1.04); animation: auth-drift 24s ease-in-out infinite alternate;
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(70% 60% at 0% 100%, #0e1a17f5, transparent 70%),
    linear-gradient(180deg, #0d1719d9 0%, #0d17198c 38%, #0d1719f2 100%);
}
@keyframes auth-drift { to { transform: scale(1.1) translate(-1.5%, -1%); } }
.auth-brand .access-brand img { width: clamp(150px, 14vw, 196px); }
.auth-pitch { max-width: 34rem; }
.auth-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; margin-bottom: 18px;
  border: 1px solid #ffffff26; border-radius: 999px; background: #ffffff12; backdrop-filter: blur(8px);
  font-size: .74rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
}
.auth-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber, #ffc15c); box-shadow: 0 0 0 3px #ffc15c33, 0 0 10px #ffc15ccc; }
html.access-page .auth-brand h2 { margin: 0; font-size: clamp(1.9rem, 3.2vw, 3rem); line-height: 1.06; letter-spacing: -.045em; font-weight: 640; text-wrap: balance; color: #fff; }
.auth-points { display: grid; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: #dfe9e3; font-size: .96rem; }
.auth-points li::before {
  content: ""; flex: none; width: 26px; height: 26px; border-radius: 9px; background: #ffffff14 center / 14px no-repeat;
  border: 1px solid #ffffff21;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffc15c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E");
}
.auth-foot { margin: 0; color: #a9bab1; font-size: .8rem; }
.auth-main.access-main {
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  width: 100%; max-width: 560px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 48px);
}
.auth-main .access-card { padding: clamp(26px, 3.4vw, 44px); animation: auth-in .45s var(--ease) both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(12px); } }
.auth-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: var(--muted); font-size: .8rem; }
.auth-note::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v6c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v6c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.auth-brand :focus-visible { outline-color: #ffd2a5; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { min-height: 0; padding: 20px clamp(18px, 5vw, 32px) 26px; gap: 22px; }
  html.access-page .auth-brand h2 { font-size: clamp(1.45rem, 6vw, 2rem); }
  .auth-points, .auth-foot { display: none; }
  .auth-chip { margin-bottom: 12px; }
  .auth-main.access-main { justify-content: flex-start; padding-top: 0; margin-top: -14px; }
  .auth-main .access-card { border-radius: 22px; }
}
@media (max-width: 420px) {
  .auth-brand .access-brand img { width: 140px; }
  .auth-main .access-card { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-brand::before, .auth-main .access-card, html.access-page .action.primary[type=submit]:disabled::before { animation: none; }
  html.access-page .action { transition: none; }
  html.access-page .action:hover:enabled, html.access-page a.action:hover { transform: none; }
}
