/* =====================================================================
   Log In, Forgot Password and Reset Password (A1 split layout, light).
   Map and motto on the left, form on the right. The pages set
   data-theme="light" themselves, so the app's light colors apply.
   ===================================================================== */

body.a1-login {
  --a1l-p1: #2f6fdb;
  --a1l-p2: #b7791f;
  --a1l-p3: #7c4fd8;
  --a1l-coral: #e8425f;
  --a1l-ctl: #c9d0d9;
  --a1l-raised: #f7f9fb;
  --a1l-accent-hover: #c22f44;
  --a1l-tint: rgba(214, 58, 79, 0.09);
  --a1l-tint-line: rgba(214, 58, 79, 0.45);
  --a1l-ok: #1e9e5a;
  --a1l-ok-tint: rgba(30, 158, 90, 0.09);
  --a1l-ok-line: rgba(30, 158, 90, 0.45);
  --a1l-glass: rgba(255, 255, 255, 0.95);
  --a1l-fade-top: rgba(244, 246, 249, 0.05);
  --a1l-fade-bottom: rgba(244, 246, 249, 0.92);
  --a1l-shadow: 0 18px 48px rgba(17, 23, 32, 0.16);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 560px);
  min-height: 100vh;
  height: auto;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font-sans);
}
body.a1-login [hidden] {
  display: none !important;
}

/* ---------- Left: map, motto, views ---------- */
body.a1-login .a1l-hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background: #e9edf1;
}
body.a1-login .a1l-map {
  position: absolute;
  inset: 0;
  background: url("/static/login-map-light.svg") center / cover no-repeat;
}
body.a1-login .a1l-marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
body.a1-login .a1l-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--a1l-fade-top) 0%, var(--a1l-fade-top) 40%, var(--a1l-fade-bottom) 100%);
}
body.a1-login .a1l-hero-text {
  position: absolute;
  left: 56px;
  right: 56px;
  bottom: 56px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body.a1-login .a1l-cap {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
body.a1-login .a1l-motto {
  margin: 0;
  font: 700 46px/1.08 var(--font-heading);
  letter-spacing: -0.01em;
  color: var(--text);
}
body.a1-login .a1l-views {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
body.a1-login .a1l-views li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--a1l-glass);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
body.a1-login .a1l-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--dot, var(--a1l-p1));
}

/* ---------- Right: form panel ---------- */
body.a1-login .a1l-panel {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 28px 64px 26px;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
body.a1-login .a1l-panel-top {
  display: flex;
  align-items: center;
  min-height: 44px;
}
body.a1-login .a1l-logo {
  display: block;
  width: 200px;
  height: auto;
  color: var(--text);
}
body.a1-login .a1l-form-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 0;
}
body.a1-login .a1l-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.a1-login .a1l-head h1 {
  margin: 0;
  font: 700 30px/1.2 var(--font-heading);
  color: var(--text);
}
body.a1-login .a1l-sub,
body.a1-login .a1l-help {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}
body.a1-login .a1l-sub {
  font-size: 15.5px;
}
body.a1-login .a1l-form,
body.a1-login .a1l-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}
body.a1-login .a1l-form {
  gap: 18px;
}
body.a1-login .a1l-step-title {
  margin: 0;
  font: 600 18px/1.3 var(--font-heading);
  color: var(--text);
}
body.a1-login .a1l-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
body.a1-login .a1l-field label,
body.a1-login .a1l-label-row {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
body.a1-login .a1l-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
body.a1-login a {
  color: var(--link);
  text-decoration: none;
}
body.a1-login a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
body.a1-login .a1l-link {
  font-size: 14px;
  font-weight: 500;
}
body.a1-login .a1l-field input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--a1l-ctl);
  border-radius: 8px;
  background: var(--a1l-raised);
  color: var(--text);
  font: 400 15px var(--font-sans);
  font-variant-numeric: tabular-nums;
  outline: none;
}
body.a1-login .a1l-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--a1l-tint);
  background: var(--panel);
}
body.a1-login .a1l-field input[readonly] {
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}
body.a1-login .a1l-field input[aria-invalid="true"] {
  border-color: var(--accent);
}
body.a1-login .a1l-field input.a1l-code {
  height: 52px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-align: center;
}
body.a1-login .a1l-field input.a1l-code::placeholder {
  color: var(--text-subtle);
  font-weight: 400;
}
body.a1-login .a1l-reveal {
  position: relative;
}
body.a1-login .a1l-reveal input {
  padding-right: 48px;
}
body.a1-login .a1l-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
body.a1-login .a1l-icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
body.a1-login .a1l-icon-btn:focus-visible,
body.a1-login .a1l-btn:focus-visible,
body.a1-login a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body.a1-login .a1l-reveal .a1l-icon-btn {
  position: absolute;
  top: 4px;
  right: 4px;
}
body.a1-login .a1l-icon-btn .a1l-i-off,
body.a1-login .a1l-icon-btn.is-on .a1l-i-on {
  display: none;
}
body.a1-login .a1l-icon-btn.is-on .a1l-i-off {
  display: block;
}

/* Account line on the two-factor steps */
body.a1-login .a1l-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--a1l-raised);
}
body.a1-login .a1l-account-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--a1l-tint);
  color: var(--accent);
}
body.a1-login .a1l-account-text {
  min-width: 0;
  line-height: 1.3;
}
body.a1-login .a1l-account-text strong {
  display: block;
  font-weight: 600;
}
body.a1-login .a1l-account-text span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--muted);
}

/* QR for two-factor setup */
body.a1-login .a1l-qr {
  display: flex;
  justify-content: center;
}
body.a1-login .a1l-qr img,
body.a1-login .a1l-qr svg {
  display: block;
  width: 168px;
  height: 168px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
body.a1-login .a1l-qr p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Error and success messages */
body.a1-login .a1l-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--a1l-tint-line);
  border-radius: 8px;
  background: var(--a1l-tint);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.4;
}
body.a1-login .a1l-msg::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: var(--a1l-coral);
  -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'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%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'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.a1-login .a1l-msg.is-ok {
  border-color: var(--a1l-ok-line);
  background: var(--a1l-ok-tint);
}
body.a1-login .a1l-msg.is-ok::before {
  background: var(--a1l-ok);
  -webkit-mask-image: 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%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.8'/%3E%3C/svg%3E");
  mask-image: 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%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.8'/%3E%3C/svg%3E");
}

/* Buttons */
body.a1-login .a1l-actions {
  display: flex;
  gap: 10px;
}
body.a1-login .a1l-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font: 600 15px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}
body.a1-login .a1l-btn-primary {
  flex: 1;
  border: 0;
  background: var(--accent);
  color: #ffffff;
}
body.a1-login .a1l-btn-primary:hover {
  background: var(--a1l-accent-hover);
}
body.a1-login .a1l-btn-secondary {
  border: 1px solid var(--a1l-ctl);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
}
body.a1-login .a1l-btn-secondary:hover {
  background: var(--hover);
  color: var(--text);
  text-decoration: none;
}
body.a1-login .a1l-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body.a1-login .a1l-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--text-subtle);
}

/* Narrow windows: form only */
@media (max-width: 920px) {
  body.a1-login {
    grid-template-columns: minmax(0, 1fr);
  }
  body.a1-login .a1l-hero {
    display: none;
  }
  body.a1-login .a1l-panel {
    padding: 24px 20px;
    border-left: 0;
  }
}
