/* DivineShield sign-in and registration pages (dark). Self-contained so the shared style.css stays untouched. */
:root {
  --bg-1: #0a1628;
  --bg-2: #0f2250;
  --bg-3: #0c1a36;
  --card: rgba(30, 41, 59, 0.72);
  --field: rgba(15, 23, 42, 0.6);
  --field-focus: rgba(15, 23, 42, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-400: #60a5fa;
  --yellow-400: #fbbf24;
  --yellow-500: #f59e0b;
  --red-400: #f87171;
  --green-400: #34d399;
  --white: #ffffff;
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font-body); color: var(--text);
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
body::before, body::after { content: ""; position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; }
body::before { width: 600px; height: 600px; top: -120px; right: -120px; background: radial-gradient(circle, rgba(37, 99, 235, .16) 0%, transparent 70%); }
body::after { width: 500px; height: 500px; bottom: -120px; left: -120px; background: radial-gradient(circle, rgba(20, 184, 166, .09) 0%, transparent 70%); }
a { color: inherit; }
h1, h2 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout: logo header above one centered card */
.auth { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-head { text-align: center; margin-bottom: 24px; text-decoration: none; color: var(--white); }
.auth-head img { width: 90px; height: 90px; object-fit: contain; display: block; margin: 0 auto 14px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .3)); }
.auth-head strong { display: block; font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.auth-head small { display: block; margin-top: 4px; font-size: .875rem; color: var(--muted); }
.form-inner {
  width: 100%; max-width: 460px; padding: 36px 36px 30px;
  background: var(--card); border: 1px solid rgba(255, 255, 255, .08); border-radius: 20px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .6);
}
.register .form-inner { max-width: 640px; }
.back-link { margin-top: 20px; font-size: .88rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--white); }
.form-inner h1 { font-size: 1.5rem; font-weight: 700; color: var(--white); }
.form-sub { margin-top: 6px; color: var(--muted); font-size: .92rem; line-height: 1.55; }

.alert {
  margin-top: 20px; padding: 14px 16px; border-radius: 12px; font-size: .9rem; line-height: 1.5;
  background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .3); border-left-width: 4px; color: #fecaca;
}
.alert strong { display: block; color: var(--red-400); margin-bottom: 2px; }
.alert.info { background: rgba(37, 99, 235, .12); border-color: rgba(59, 130, 246, .35); color: #bfdbfe; }
.alert.info strong { color: var(--blue-400); }

form { margin-top: 24px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field + .field { margin-top: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: .78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.field label small { font-weight: 500; color: var(--faint); text-transform: none; letter-spacing: 0; }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 50px; padding: 0 16px;
  font: inherit; font-size: 1rem; color: var(--white);
  background: var(--field); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; background: var(--field-focus); border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .25); }
.input.invalid { border-color: var(--red-400); }
.input.invalid:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, .2); }
.input.valid { border-color: rgba(52, 211, 153, .6); }
.input.has-toggle { padding-right: 64px; }
.input:-webkit-autofill { -webkit-text-fill-color: var(--white); -webkit-box-shadow: 0 0 0 100px #111c33 inset; caret-color: var(--white); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-repeat: no-repeat; background-position: calc(100% - 21px) 52%, calc(100% - 16px) 52%; background-size: 5px 5px;
}
select.input option { background: #1e293b; color: var(--white); }
select.input:disabled { cursor: not-allowed; color: var(--faint); background-color: rgba(15, 23, 42, .35); }
.textarea { height: auto; min-height: 90px; padding: 12px 16px; resize: vertical; line-height: 1.5; }

.field-msg { margin-top: 6px; font-size: .82rem; line-height: 1.4; color: var(--muted); }
.field-msg:empty { display: none; }
.field-msg.error { color: var(--red-400); }
.field-msg.ok { color: var(--green-400); }

.toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent;
  font: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer;
}
.toggle:hover, .toggle:focus-visible { color: var(--white); background: rgba(255, 255, 255, .08); outline: none; }

.caps-hint { margin-top: 6px; font-size: .82rem; color: var(--yellow-400); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .98rem; cursor: pointer; text-decoration: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.btn-primary { background: var(--blue-600); color: var(--white); box-shadow: 0 10px 24px -12px rgba(37, 99, 235, .9); }
.btn-primary:hover { background: var(--blue-700); }
.btn-accent { background: var(--yellow-400); color: #0a1628; }
.btn-accent:hover { background: var(--yellow-500); }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: var(--line-strong); color: var(--white); }
.btn-block { width: 100%; margin-top: 24px; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn:focus-visible { outline: 3px solid rgba(96, 165, 250, .5); outline-offset: 2px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; display: none;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-foot { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); text-align: center; }
.form-foot a { color: var(--blue-400); font-weight: 700; text-decoration: none; }
.form-foot a:hover { text-decoration: underline; }

/* Admin PIN step */
.pin-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pin-digit-input {
  width: 100%; height: 62px; text-align: center;
  font: inherit; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--white);
  background: var(--field); border: 1px solid var(--line); border-radius: 14px;
}
.pin-digit-input:focus { outline: none; background: var(--field-focus); border-color: var(--yellow-500); box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); }
.pin-digit-input.filled { border-color: var(--yellow-500); background: rgba(245, 158, 11, .12); }
.pin-actions { display: grid; gap: 10px; margin-top: 24px; }
.pin-actions .btn-block { margin-top: 0; }
.pin-note { margin-top: 16px; font-size: .84rem; color: var(--muted); text-align: center; }

/* Notice modal (QR attendance, registration disabled) */
.notice-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(2, 6, 23, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.notice-modal {
  width: 100%; max-width: 400px; padding: 28px; border-radius: 18px; text-align: center;
  background: #1e293b; border: 1px solid var(--line); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7);
}
.notice-modal h2 { font-size: 1.2rem; color: var(--white); }
.notice-modal p { margin-top: 8px; color: var(--text-2); font-size: .92rem; line-height: 1.55; }
.notice-modal .btn { width: 100%; margin-top: 20px; }

/* Registration stepper */
.stepper { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; counter-reset: step; }
.stepper li { counter-increment: step; display: flex; flex-direction: column; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--faint); }
.stepper li::before { content: ""; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .1); transition: background .3s; }
.stepper li span::before { content: counter(step) ". "; }
.stepper li.is-active { color: var(--blue-400); }
.stepper li.is-active::before { background: var(--blue-600); }
.stepper li.is-done { color: var(--text-2); }
.stepper li.is-done::before { background: var(--green-400); }

.grid-2, .grid-3 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.field + .grid-2, .field + .grid-3, .grid-2 + .grid-2, .grid-2 + .field, .grid-3 + .grid-2, .grid-3 + .field { margin-top: 18px; }
.grid-2 .field + .field, .grid-3 .field + .field { margin-top: 0; }
.hint { margin-top: 12px; font-size: .85rem; color: #fde68a; background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .3); padding: 10px 14px; border-radius: 10px; }
.step-actions { margin-top: 28px; display: flex; justify-content: flex-end; gap: 12px; }
.step-actions .btn { min-width: 140px; }
.step-actions .btn-ghost { margin-right: auto; }

.rules { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.rules li { position: relative; padding-left: 22px; font-size: .84rem; color: var(--muted); }
.rules li::before { content: "\25CB"; position: absolute; left: 2px; top: 0; }
.rules li.ok { color: var(--green-400); }
.rules li.ok::before { content: "\2713"; font-weight: 800; }

.review { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: rgba(15, 23, 42, .5); border: 1px solid var(--line); font-size: .86rem; line-height: 1.6; color: var(--text-2); }
.review dt { font-weight: 700; color: var(--faint); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.review dd { margin: 0 0 8px; }
.review dd:last-child { margin-bottom: 0; }
.review-edit { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--blue-400); cursor: pointer; font-size: .82rem; text-transform: none; letter-spacing: 0; }

.check { margin-top: 20px; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .88rem; color: var(--text-2); line-height: 1.5; }
.check a { color: var(--blue-400); font-weight: 600; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--blue-600); cursor: pointer; }

.done-view { text-align: center; padding-top: 8px; }
.done-icon {
  width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(52, 211, 153, .14); color: var(--green-400); font-size: 2.2rem; font-weight: 800;
}
.done-view .form-sub { max-width: 40ch; margin: 10px auto 0; }

/* Responsive */
@media (max-width: 560px) {
  .auth-main { padding: 24px 12px 28px; justify-content: flex-start; }
  .auth-head { margin-bottom: 18px; }
  .auth-head img { width: 64px; height: 64px; margin-bottom: 10px; }
  .auth-head strong { font-size: 1.4rem; }
  .form-inner { padding: 24px 18px 22px; border-radius: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .step-actions .btn { min-width: 0; flex: 1; }
  .pin-digit-input { height: 56px; }
}
