/*
 * Sign-in screens for both portals (admin and client).
 *
 * One centred card over a full-bleed photograph. The previous design put half the
 * screen into an informational column that nobody signing in reads — it pushed the
 * form into a narrow strip and collapsed awkwardly on a laptop. Everything here
 * serves one job: let someone sign in quickly and get back to the public site if
 * they landed here by mistake.
 *
 * Loaded by every page under /admin and /client that shows an auth shell, so the
 * password reset, OTP and activation screens stay visually identical to the login.
 */

:root {
  --auth-navy: #071f33;
  --auth-blue: #1686bd;
  --auth-green: #9bd63e;
  --auth-ink: #17212a;
  --auth-muted: #6b7f8a;
  --auth-line: #e2eae8;
  --auth-danger: #b3283a;
}

.emdor-auth {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--auth-ink);
  isolation: isolate;
  overflow: hidden;
}

/* ── Background ───────────────────────────────────────────────────────────────
   The photograph is a decorative layer behind everything, dimmed enough that
   white text and a white card both hold up over it regardless of the image. */
.emdor-auth::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--auth-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
}
.emdor-auth::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(7, 31, 51, .55), rgba(7, 31, 51, .88) 70%),
    linear-gradient(180deg, rgba(7, 31, 51, .6), rgba(4, 18, 30, .92));
}

/* ── Back to the public site ─────────────────────────────────────────────── */
.auth-back {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px 10px 15px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s, border-color .18s, transform .18s;
}
.auth-back:hover,
.auth-back:focus-visible {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .5);
  color: #fff;
  transform: translateX(-2px);
  outline: 0;
}
.auth-back i { font-size: .72rem; }

/* ── The card ─────────────────────────────────────────────────────────────── */
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 452px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 38px 34px;
  box-shadow: 0 30px 80px rgba(3, 14, 24, .45), 0 2px 8px rgba(3, 14, 24, .2);
  animation: auth-rise .45s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
}

.auth-card > .auth-logo {
  display: block;
  margin: 0 auto 22px;
  width: 152px;
}
.auth-card > .auth-logo img { width: 100%; height: auto; display: block; }

/* A small badge stating which portal this is — the two look alike otherwise. */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 6px 13px;
  border-radius: 30px;
  background: #eef6fa;
  color: var(--auth-blue);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.auth-badge.staff { background: #f2f7ec; color: #5d8f1c; }
.auth-badge i { font-size: .66rem; }

.auth-card h1 {
  font: 800 1.62rem/1.2 Montserrat, sans-serif;
  letter-spacing: -.03em;
  color: var(--auth-navy);
  margin: 0 0 7px;
}
.auth-card > p {
  margin: 0 0 26px;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--auth-muted);
}

/* ── Fields ───────────────────────────────────────────────────────────────── */
.auth-card form label {
  display: block;
  margin-bottom: 16px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #3f5561;
}
.auth-field {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 7px;
}
.auth-field > i:first-child {
  position: absolute;
  left: 15px;
  color: #93a5ae;
  font-size: .82rem;
  pointer-events: none;
  transition: color .15s;
}
.auth-field input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 42px;
  border: 1px solid #d3ddda;
  border-radius: 11px;
  background: #fbfdfc;
  font-size: .88rem;
  font-weight: 500;
  color: var(--auth-ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-field input::placeholder { color: #a6b4bb; font-weight: 400; }
.auth-field input:hover { border-color: #b3c4cd; }
.auth-field input:focus {
  outline: 0;
  background: #fff;
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 4px rgba(22, 134, 189, .13);
}
.auth-field:focus-within > i:first-child { color: var(--auth-blue); }
.auth-field.has-toggle input { padding-right: 48px; }
.auth-toggle {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: none;
  color: #8ea0a9;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-toggle:hover { background: #eef3f1; color: var(--auth-navy); }

/* One-time-code entry, used by the OTP screens. */
.auth-otp { display: flex; gap: 9px; justify-content: space-between; margin-top: 8px; }
.auth-otp input {
  width: 100%;
  height: 56px;
  padding: 0;
  text-align: center;
  font: 700 1.3rem Montserrat, sans-serif;
  border: 1px solid #d3ddda;
  border-radius: 11px;
  background: #fbfdfc;
}
.auth-otp input:focus {
  outline: 0;
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 4px rgba(22, 134, 189, .13);
}

/* ── Row between the fields and the button ────────────────────────────────── */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
  font-size: .76rem;
}
.auth-row .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  color: #55696f;
  cursor: pointer;
}
.auth-row .check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--auth-blue);
  cursor: pointer;
}
.auth-row a { color: var(--auth-blue); font-weight: 700; text-decoration: none; }
.auth-row a:hover { text-decoration: underline; }

/* ── Submit ───────────────────────────────────────────────────────────────── */
.auth-submit {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--auth-blue), #0f6a97);
  color: #fff;
  font: 700 .92rem Montserrat, sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 10px 24px rgba(22, 134, 189, .3);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.auth-submit:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(22, 134, 189, .38); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: .65; cursor: default; box-shadow: none; }
.auth-submit.staff { background: linear-gradient(135deg, #12384f, var(--auth-navy)); box-shadow: 0 10px 24px rgba(7, 31, 51, .34); }
.auth-submit.staff:hover { box-shadow: 0 14px 30px rgba(7, 31, 51, .42); }

/* ── Footer inside the card ───────────────────────────────────────────────── */
.auth-foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--auth-line);
  text-align: center;
  font-size: .76rem;
  color: var(--auth-muted);
  line-height: 1.6;
}
.auth-foot a { color: var(--auth-blue); font-weight: 700; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-secure {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: .68rem;
  color: #8ba0a9;
}
.auth-secure i { color: var(--auth-green); }

/* Caption under the card, outside it. */
.auth-caption {
  position: relative;
  z-index: 2;
  margin: 20px auto 0;
  max-width: 452px;
  text-align: center;
  font-size: .72rem;
  color: rgba(255, 255, 255, .62);
}

/* ── Feedback ─────────────────────────────────────────────────────────────── */
.auth-note {
  margin: -6px 0 20px;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid #cfe5ef;
  border-left: 3px solid var(--auth-blue);
  background: #f1f8fb;
  font-size: .76rem;
  line-height: 1.55;
  color: #3d5865;
}
.auth-note.warn { border-color: #f0d79a; border-left-color: #c9932a; background: #fff8e9; color: #6a5421; }
.auth-note strong { display: block; color: var(--auth-navy); }

.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 150%);
  z-index: 60;
  max-width: min(440px, calc(100vw - 36px));
  padding: 13px 19px;
  border-radius: 11px;
  background: var(--auth-navy);
  border-left: 4px solid var(--auth-green);
  color: #fff;
  font-size: .8rem;
  line-height: 1.5;
  box-shadow: 0 18px 44px rgba(3, 14, 24, .4);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}
.auth-toast.show { transform: translate(-50%, 0); }
.auth-toast.is-error { border-left-color: var(--auth-danger); }

/* ── Small screens ────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .emdor-auth { padding: 84px 14px 30px; align-items: start; }
  .auth-back { top: 16px; left: 14px; padding: 9px 15px 9px 13px; font-size: .74rem; }
  .auth-card { padding: 30px 22px 26px; border-radius: 16px; }
  .auth-card h1 { font-size: 1.38rem; }
  .auth-card > .auth-logo { width: 130px; }
  .auth-otp input { height: 48px; font-size: 1.1rem; }
}
@media (max-width: 380px) {
  .auth-otp { gap: 6px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Carry the redesign across the sibling auth screens
   ═══════════════════════════════════════════════════════════════════════════
   Forgot password, OTP, reset and activation still use the original two-column
   shells (.admin-auth / .auth-shell). Rather than rewrite five near-identical
   templates, restyle those shells into the same centred card: the informational
   column is hidden, the panel becomes the backdrop, and the inner box picks up
   the card treatment. This file loads after admin.css / portal.css, so these
   win on order at equal specificity.
   ─────────────────────────────────────────────────────────────────────────── */
.admin-auth,
.auth-shell {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 18px;
  grid-template-columns: none !important;
  background: none;
  isolation: isolate;
  overflow: hidden;
}
.admin-auth::before,
.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--auth-image, url("../images/client/emdor-office-property.jpeg"));
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
}
.admin-auth::after,
.auth-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(7, 31, 51, .55), rgba(7, 31, 51, .88) 70%),
    linear-gradient(180deg, rgba(7, 31, 51, .6), rgba(4, 18, 30, .92));
}

/* The informational column is the thing being removed. */
.admin-auth > section:first-child,
.auth-shell > section:first-child,
.admin-auth-visual,
.auth-brand {
  display: none !important;
}

/* The remaining panel is just a wrapper now — the card inside carries the design. */
.admin-auth > section:last-child,
.auth-shell > section:last-child,
.admin-auth-panel,
.auth-panel {
  position: static !important;
  display: block !important;
  width: 100%;
  max-width: 452px;
  min-height: 0 !important;
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* Restyle the inner box to match .auth-card. */
.admin-auth .auth-box,
.auth-shell .auth-card {
  width: 100%;
  max-width: none;
  background: #fff;
  border: 0;
  border-radius: 20px;
  padding: 38px 34px 30px;
  box-shadow: 0 30px 80px rgba(3, 14, 24, .45), 0 2px 8px rgba(3, 14, 24, .2);
  text-align: left;
}
.admin-auth .auth-box h2,
.auth-shell .auth-card h2 {
  font: 800 1.5rem/1.2 Montserrat, sans-serif;
  letter-spacing: -.03em;
  color: var(--auth-navy);
  margin: 6px 0 7px;
}
.admin-auth .auth-box > small,
.auth-shell .auth-card .eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 30px;
  background: #eef6fa;
  color: var(--auth-blue);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.admin-auth .auth-box > p,
.auth-shell .auth-card > p {
  margin: 0 0 22px;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--auth-muted);
}
.admin-auth .auth-box label,
.auth-shell .auth-card label {
  display: block;
  margin-bottom: 15px;
  font-size: .7rem;
  font-weight: 700;
  color: #3f5561;
  text-transform: none;
  letter-spacing: .02em;
}
.admin-auth .auth-box input:not([type="checkbox"]),
.auth-shell .auth-card input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  height: 50px;
  margin-top: 7px;
  padding: 0 16px;
  border: 1px solid #d3ddda;
  border-radius: 11px;
  background: #fbfdfc;
  font-size: .88rem;
  color: var(--auth-ink);
  transition: border-color .15s, box-shadow .15s;
}
.admin-auth .auth-box input:not([type="checkbox"]):focus,
.auth-shell .auth-card input:not([type="checkbox"]):focus {
  outline: 0;
  background: #fff;
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 4px rgba(22, 134, 189, .13);
}
.admin-auth .auth-box .btn,
.admin-auth .auth-box button[type="submit"],
.auth-shell .auth-card .btn,
.auth-shell .auth-card button[type="submit"] {
  width: 100%;
  height: 52px;
  margin-top: 6px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--auth-blue), #0f6a97);
  color: #fff;
  font: 700 .92rem Montserrat, sans-serif;
  box-shadow: 0 10px 24px rgba(22, 134, 189, .3);
  cursor: pointer;
}
.admin-auth .auth-box .btn:hover,
.auth-shell .auth-card .btn:hover { filter: brightness(1.06); color: #fff; }
.admin-auth .auth-box .auth-link,
.auth-shell .auth-card .auth-link,
.admin-auth .auth-box a:not(.btn),
.auth-shell .auth-card a:not(.btn) {
  color: var(--auth-blue);
  font-weight: 700;
  font-size: .78rem;
  text-decoration: none;
}
.admin-auth .auth-box .auth-link { display: block; margin-top: 18px; text-align: center; }

/* The old "back" link becomes the floating pill. */
.admin-auth .back,
.auth-shell .back {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 18px 10px 15px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff !important;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
}
.admin-auth .back:hover,
.auth-shell .back:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); }

@media (max-width: 575.98px) {
  .admin-auth, .auth-shell { padding: 84px 14px 30px; justify-content: flex-start; }
  .admin-auth .back, .auth-shell .back { top: 16px; left: 14px; }
  .admin-auth .auth-box, .auth-shell .auth-card { padding: 28px 20px 24px; border-radius: 16px; }
}
