/* ════════════════════════════════════════════════════
   MAPO — Login view
   ════════════════════════════════════════════════════ */

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Login topbar */
.login-topbar {
  height: 66px;
  background: var(--white);
  border-bottom: 2px solid var(--red);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.login-topbar .brand-wide { height: 50px; }
.login-topbar .brand-sub {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  padding-left: 14px;
  margin-left: 4px;
}
.login-topbar .right {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.login-topbar .right i { font-size: 14px; color: var(--green); }

/* Body */
.login-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

/* Recovery wrap — keeps the login card + slide-out tab + panel together */
.login-recovery-wrap {
  position: relative;
  width: 100%;
  max-width: 430px;
  display: flex;
  align-items: stretch;
}

/* Card */
.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 2;
}

/* ── Recovery slide-out tab (pinned to right edge of the login card) ── */
.recovery-tab {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translate(-1px, -50%);
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 0 5px 5px 0;
  width: 22px;                 /* thinner */
  min-height: 180px;           /* longer */
  padding: 14px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background .15s, transform .2s;
  z-index: 1;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.08);
}
.recovery-tab:hover {
  background: var(--red-hover, #8d1216);
}
.recovery-tab i { font-size: 14px; }
.recovery-tab-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 2px;
  font-size: 10px;
}
/* When panel is open, hide the tab (the close button in the panel replaces it) */
.login-recovery-wrap.open .recovery-tab {
  opacity: 0;
  pointer-events: none;
}

/* ── Recovery panel (slides out to the right of the card) ── */
.recovery-panel {
  position: absolute;
  top: 0;
  left: 100%;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: var(--white);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  box-shadow: 8px 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateX(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, opacity .2s ease;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.login-recovery-wrap.open .recovery-panel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}
.recovery-head {
  padding: 14px 20px;
  background: var(--dkgray);
  display: flex;
  align-items: center;
  gap: 10px;
}
.recovery-head-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.recovery-head-title i { font-size: 15px; color: rgba(255,255,255,0.7); }
.recovery-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
}
.recovery-close:hover { color: #fff; }

.recovery-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle, #f7f7f7);
}
.recovery-mode {
  background: transparent;
  border: none;
  padding: 12px 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color .15s, background .15s;
  border-bottom: 2px solid transparent;
}
.recovery-mode:hover { color: var(--red); }
.recovery-mode.active {
  color: var(--red);
  background: #fff;
  border-bottom-color: var(--red);
}
.recovery-mode i { font-size: 15px; }

.recovery-body {
  padding: 20px 22px 16px;
  flex: 1 1 auto;
}
.recovery-mode-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.recovery-form .form-field { margin-bottom: 14px; }

.recovery-msg {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  display: none;
}
.recovery-msg.show { display: block; }
.recovery-msg.success {
  background: #e8f4ea;
  border: 1px solid #c2dec7;
  border-left: 3px solid #27ae60;
  color: #2c7a3a;
}
.recovery-msg.error {
  background: var(--red-light);
  border: 1px solid var(--red-border);
  border-left: 3px solid var(--red);
  color: var(--red);
}

.recovery-foot {
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.recovery-foot a { color: var(--red); text-decoration: none; font-weight: 700; }
.recovery-foot a:hover { text-decoration: underline; }

/* Responsive — on narrow screens, panel drops below the card instead of beside it */
@media (max-width: 900px) {
  .recovery-panel {
    left: 0;
    top: calc(100% + 8px);
    width: 100%;
    border-left: 1px solid var(--border);
    border-radius: 8px;
    min-height: 0;
    transform: translateY(-8px);
  }
  .login-recovery-wrap.open .recovery-panel {
    transform: translateY(0);
  }
}
.login-card-head {
  padding: 14px 24px;
  background: var(--dkgray);
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-card-head i { color: rgba(255, 255, 255, 0.7); font-size: 15px; }
.login-card-head-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
}

.login-form-body { padding: 28px 28px 24px; }

.welcome-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--black);
  line-height: 1;
  margin-bottom: 4px;
}
.welcome-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* Form fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: border-color 0.15s, background 0.15s;
}
.input-wrap:focus-within {
  border-color: var(--red-border);
  background: var(--white);
}
.input-wrap > i {
  color: var(--text-muted);
  font-size: 15px;
  padding-left: 11px;
}
.input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 9px 11px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
}
.input-wrap input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.pw-toggle {
  background: transparent;
  border: none;
  padding: 0 11px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.pw-toggle:hover { color: var(--red); }
.pw-toggle i { font-size: 15px; }

/* Primary button */
.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--red);
  border: none;
  border-radius: 6px;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: background 0.15s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--red-hover); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-primary.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Error banner */
.error-msg {
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--red-light);
  border: 1px solid var(--red-border);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
  display: none;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}
.error-msg.show { display: flex; }
.error-msg i {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Register button — same size as Sign In but inverted (white bg, red border/text) */
.btn-secondary {
  width: 100%;
  padding: 11px;
  background: #fff;
  border: 1.5px solid var(--red);
  border-radius: 6px;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--red);
  cursor: pointer;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
}
.btn-secondary:hover {
  background: var(--red-light, #fde9ea);
}
.btn-secondary:active {
  background: var(--red);
  color: #fff;
}

/* Card footer */
.login-card-foot {
  padding: 12px 24px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.login-card-foot a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}
.login-card-foot a:hover { color: var(--red); }

/* Responsive */
@media (max-width: 560px) {
  .login-topbar .brand-sub { display: none; }
}

/* ── Additions for the ported ASP.NET pages ────────────────────
   Not in the mapo-v2 original: that page had no remember-me control and
   surfaced errors only through the single #errorMsg strip, whereas the
   Identity pages also render per-field validation messages. */

/* Button label — the v2 markup wraps it so the spinner can replace it. */
.btn-primary .btn-text,
.btn-secondary .btn-text { display: inline; }
.btn-primary.loading .btn-text { opacity: .65; }

/* Per-field validation message (asp-validation-for). */
.field-error {
  display: block;
  margin-top: 5px;
  min-height: 1em;
  font-size: 12px;
  line-height: 1.35;
  color: var(--red);
}
.field-error:empty { display: none; }

/* Remember-me row. */
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.login-remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--red);
  cursor: pointer;
}

/* The validation summary renders a <ul> inside the error strip. */
.error-msg ul { margin: 0; padding-left: 16px; }
.error-msg div { display: inline; }
