:root {
  --pmb-red:#e30613;
  --pmb-red-dark:#c10821;
  --pmb-anthracite:#242424;
  --pmb-charcoal:#474747;
  --pmb-soft:#f4f3f4;
  --auth-border:#d8dddf;
  --auth-muted:#626b70;
  color-scheme:light;
}

* {
  box-sizing:border-box;
}

[hidden] {
  display:none !important;
}

html {
  min-height:100%;
  background:#e8ecee;
}

body {
  min-height:100dvh;
  margin:0;
  color:#111;
  background:
    linear-gradient(180deg,rgba(255,255,255,.84),rgba(255,255,255,.18)),
    linear-gradient(145deg,#eef1f2 0%,#dfe4e6 52%,#edf0f1 100%);
  font-family:"Open Sans",Arial,Helvetica,sans-serif;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

button,
input {
  font:inherit;
  -webkit-tap-highlight-color:transparent;
}

.auth-shell {
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:24px;
}

.auth-card {
  width:min(430px,100%);
  padding:28px 26px 24px;
  border:1px solid var(--auth-border);
  border-top:4px solid var(--pmb-red);
  border-radius:12px;
  background:#fff;
  box-shadow:0 22px 56px rgba(25,32,36,.16);
}

.auth-logo {
  display:block;
  width:auto;
  height:48px;
  max-width:72%;
  object-fit:contain;
  margin:0 auto 22px;
}

.auth-heading {
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  gap:12px;
  align-items:start;
  margin:0 0 22px;
}

.auth-heading h1 {
  margin:0;
  color:var(--pmb-anthracite);
  font-size:24px;
  line-height:1.18;
}

.auth-heading p,
.auth-checking-card p {
  margin:5px 0 0;
  color:var(--auth-muted);
  font-size:14px;
  line-height:1.45;
}

.auth-security-mark {
  position:relative;
  display:block;
  width:32px;
  height:32px;
  border:2px solid var(--pmb-anthracite);
  border-radius:50%;
}

.auth-security-mark::before {
  content:"";
  position:absolute;
  left:9px;
  top:7px;
  width:10px;
  height:8px;
  border:2px solid var(--pmb-anthracite);
  border-bottom:0;
  border-radius:7px 7px 0 0;
}

.auth-security-mark::after {
  content:"";
  position:absolute;
  left:8px;
  top:14px;
  width:12px;
  height:10px;
  border-radius:2px;
  background:var(--pmb-red);
}

.auth-field {
  display:grid;
  gap:6px;
  margin-bottom:14px;
}

.auth-field label {
  color:#293136;
  font-size:13px;
  font-weight:800;
}

.auth-field input {
  width:100%;
  min-height:48px;
  padding:11px 12px;
  border:1px solid #bfc8cc;
  border-radius:8px;
  color:#111;
  background:#fff;
  font-size:16px;
  outline:none;
}

.auth-field input:focus {
  border-color:var(--pmb-anthracite);
  box-shadow:0 0 0 3px rgba(36,36,36,.12);
}

.remember-row {
  display:flex;
  align-items:flex-start;
  gap:9px;
  margin:3px 0 4px;
  color:#374146;
  font-size:13px;
  font-weight:700;
  line-height:1.4;
}

.remember-row input {
  flex:0 0 auto;
  width:18px;
  height:18px;
  margin:0;
  accent-color:var(--pmb-red);
}

.auth-button {
  width:100%;
  min-height:48px;
  margin-top:12px;
  padding:11px 16px;
  border:0;
  border-radius:8px;
  cursor:pointer;
  font-size:15px;
  font-weight:800;
  touch-action:manipulation;
}

.auth-button-primary {
  color:#fff;
  background:var(--pmb-red);
}

.auth-button-primary:hover {
  background:var(--pmb-red-dark);
}

.auth-button-secondary {
  color:var(--pmb-anthracite);
  background:#e8e6df;
}

.auth-button:focus-visible {
  outline:3px solid rgba(227,6,19,.28);
  outline-offset:2px;
}

.auth-button:disabled {
  cursor:wait;
  opacity:.65;
}

.auth-message {
  min-height:20px;
  margin-top:13px;
  color:#991b1b;
  font-size:13px;
  font-weight:800;
  line-height:1.4;
}

.auth-message[data-kind="success"] {
  color:#166534;
}

.mfa-setup-box {
  display:grid;
  gap:9px;
  margin:0 0 14px;
  padding:12px;
  border:1px solid #b9cbd7;
  border-radius:8px;
  background:#f1f6f8;
}

.mfa-setup-box p {
  margin:0;
  color:#263d49;
  font-size:13px;
  font-weight:700;
  line-height:1.4;
}

.mfa-qr-wrap {
  display:flex;
  justify-content:center;
  padding:4px 0;
}

.mfa-qr-image {
  width:220px;
  max-width:100%;
  height:auto;
  border:1px solid #b9cbd7;
  border-radius:8px;
  background:#fff;
}

.mfa-secret-input {
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13px !important;
}

.auth-checking-card {
  text-align:center;
}

.auth-checking-card .auth-logo {
  margin-bottom:28px;
}

.auth-spinner {
  width:32px;
  height:32px;
  margin:0 auto 10px;
  border:3px solid #d8dddf;
  border-top-color:var(--pmb-red);
  border-radius:50%;
  animation:auth-spin .8s linear infinite;
}

@keyframes auth-spin {
  to {
    transform:rotate(360deg);
  }
}

@media (max-width:520px) {
  .auth-shell {
    place-items:start center;
    padding:20px 14px max(20px,env(safe-area-inset-bottom));
  }

  .auth-card {
    margin-top:max(16px,env(safe-area-inset-top));
    padding:23px 19px 20px;
    border-radius:10px;
    box-shadow:0 14px 36px rgba(25,32,36,.14);
  }

  .auth-logo {
    height:44px;
    margin-bottom:19px;
  }

  .auth-heading {
    grid-template-columns:30px minmax(0,1fr);
    gap:10px;
    margin-bottom:19px;
  }

  .auth-heading h1 {
    font-size:22px;
  }

  .auth-security-mark {
    width:29px;
    height:29px;
  }

  .auth-security-mark::before {
    left:8px;
    top:6px;
  }

  .auth-security-mark::after {
    left:7px;
    top:13px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .auth-spinner {
    animation-duration:1.6s;
  }
}
