/*
 * Admin sign-in pages - views/admin/Login.php and Login_Verify.php, with the brand
 * panel in views/admin/Login_Brand.php. Stand-alone: the pages load none of the
 * Material Dashboard CSS, so nothing here has to fight it.
 */
:root {
  --brand: #035fe0;
  --brand-dark: #0345a8;
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --line: #d8dee8;
  --page: #f5f7fb;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-line: #fecdca;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --ok-line: #abefc6;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --warn-line: #fedf89;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

.lg { display: flex; min-height: 100vh; }

/* Brand panel - the admin's own blue, the one its drawers and headers use. */
.lg-brand {
  flex: 0 0 44%;
  max-width: 640px;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(160deg, #0b2350 0%, #023480 55%, #035fe0 100%);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
}
.lg-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 80%);
  mask-image: linear-gradient(180deg, #000, transparent 80%);
}
.lg-brand::after {
  content: '';
  position: absolute;
  width: 560px;
  height: 560px;
  right: -200px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 65%);
}
.lg-brand > * { position: relative; z-index: 1; }
/* The logo drawn white on the blue. The file has blank space around the mark, hence
   the height. */
.lg-brand-logo { height: 64px; width: auto; align-self: flex-start; filter: brightness(0) invert(1); }
.lg-brand-copy { margin-top: auto; }
.lg-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
  margin: 0 0 14px;
}
.lg-brand h2 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 16px;
  max-width: 440px;
}
.lg-brand p.lg-lead {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .78);
  margin: 0;
  max-width: 420px;
}
.lg-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 13px; }
.lg-points li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: rgba(255, 255, 255, .9); }
.lg-points .lg-tick {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The card side */
.lg-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.lg-center { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.lg-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 16px 40px -16px rgba(16, 24, 40, .16);
  padding: 40px 36px;
}
.lg-card-logo { display: none; height: 54px; width: auto; margin: -6px 0 22px -4px; }
.lg-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.lg-sub { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 0 26px; }
.lg-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eaf2fe;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* Messages above the form: an error (default), a success, a warning. */
.lg-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.45;
  margin: 0 0 20px;
}
.lg-alert[hidden] { display: none; }
.lg-alert svg { flex: 0 0 18px; margin-top: 1px; }
.lg-alert-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.lg-alert-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }

.lg-field { margin-bottom: 18px; }
.lg-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 7px; }
.lg-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.lg-link { font-size: 13px; font-weight: 500; color: var(--brand); text-decoration: none; }
.lg-link:hover { color: var(--brand-dark); text-decoration: underline; }
.lg-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.lg-input { position: relative; }
.lg-input .lg-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
}
.lg-input input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 14px 0 42px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.lg-input input::placeholder { color: #a0aec0; }
.lg-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(3, 95, 224, .12); }
.lg-input:focus-within .lg-ico { color: var(--brand); }
.lg-input input.lg-has-toggle { padding-right: 48px; }
.lg-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lg-toggle:hover { background: #f1f5f9; color: #334155; }
.lg-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.lg-caps { display: none; font-size: 12.5px; color: var(--warn); margin-top: 7px; }
.lg-caps.show { display: block; }

/* One box per OTP digit. */
.lg-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.lg-otp input {
  width: 100%;
  min-width: 0;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: center;
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  caret-color: var(--brand);
  transition: border-color .15s, box-shadow .15s;
}
.lg-otp input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(3, 95, 224, .12); }
.lg-otp.invalid input { border-color: #f04438; }
.lg-otp.invalid input:focus { box-shadow: 0 0 0 4px rgba(240, 68, 56, .14); }

.lg-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.lg-btn:hover { background: var(--brand-dark); }
.lg-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(3, 95, 224, .28); }
.lg-btn[disabled] { opacity: .85; cursor: progress; }
.lg-btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: none; margin-top: 10px; }
.lg-btn-ghost:hover { background: #f8fafc; border-color: #c4ccd8; color: var(--ink); }
.lg-btn-ghost:focus-visible { box-shadow: 0 0 0 4px rgba(3, 95, 224, .18); }
/* The default action when a page opens with the focus on it - the OTP page's Verify
   when the code arrives filled in. A ring drawn outside the box, held by a class as
   well as :focus, because browsers often paint no focus ring for a focus the page set
   itself. It pulses twice on arrival, then settles. */
.lg-btn.is-focused,
.lg-btn.is-focused:focus { box-shadow: 0 0 0 4px rgba(3, 95, 224, .3); animation: lg-ring 1.1s ease-out 2; }
@keyframes lg-ring {
  50% { box-shadow: 0 0 0 7px rgba(3, 95, 224, .12); }
}
.lg-spin {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lg-spin .7s linear infinite;
}
.lg-btn.busy .lg-spin { display: block; }
@keyframes lg-spin { to { transform: rotate(360deg); } }

.lg-note {
  margin: 22px 0 0;
  font-size: 12.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.lg-resend { margin: 22px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.lg-foot { padding: 18px 24px 22px; text-align: center; font-size: 12.5px; color: var(--muted); }
.lg-foot a { color: inherit; font-weight: 500; text-decoration: none; }
.lg-foot a:hover { color: var(--brand); }

@media (max-width: 991.98px) {
  .lg-brand { display: none; }
  .lg-card-logo { display: block; }
}
/* A phone gets the form flat on white rather than a small card floating on grey. */
@media (max-width: 480px) {
  body, .lg-main { background: #fff; }
  .lg-center { padding: 32px 16px 16px; align-items: flex-start; }
  .lg-card { border: 0; box-shadow: none; border-radius: 0; padding: 0; }
  .lg-foot { border-top: 1px solid #eef1f5; }
  .lg-otp { gap: 8px; }
  .lg-otp input { height: 50px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .lg-btn.is-focused { animation: none; }
  .lg-spin { animation-duration: 2s; }
}
