/* Auth pages: sign-in (split layout with 3D scene), change password, forgot password. */

body.tamkeen-login-body {
  padding: 0 !important;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(43, 179, 163, 0.18), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(242, 169, 59, 0.14), transparent 60%),
    #f4f7fb;
}

/* ---------------------------------------------------------------- split layout (sign-in) */
.login-page.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(400px, 540px) 1fr;
  /* neutralise the legacy .login-page centring, padding and backdrop from styles.css */
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: none;
}
.login-page.auth-split::before, .login-page.auth-split::after { display: none; }

.auth-form-side {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px clamp(24px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  z-index: 2;
}
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand svg { width: 46px; height: 46px; filter: drop-shadow(0 8px 16px rgba(15, 91, 120, 0.28)); }
.auth-brand strong { display: block; font-size: 1.35rem; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.auth-brand small { font-size: 0.78rem; color: var(--text-muted); }

.auth-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; max-width: 420px; width: 100%; margin: 0 auto; }
.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 0.78rem; font-weight: 700; color: #0b6a5f; background: var(--tk-teal-soft, #e5f6f3);
  border-radius: 999px; padding: 5px 12px; margin-bottom: 14px;
}
.auth-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal, #2bb3a3); box-shadow: 0 0 0 4px rgba(43, 179, 163, 0.18); }
.auth-title { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; color: var(--primary-dark); line-height: 1.2; }
.auth-lead { color: var(--text-muted); margin: 8px 0 26px; font-size: 0.98rem; }

.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 0.86rem; font-weight: 700; color: #334155; margin-bottom: 7px; }
.auth-input { position: relative; }
.auth-input > svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #8796a8; pointer-events: none; }
.auth-input input {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--text);
  padding: 14px 46px 14px 46px; border-radius: 14px; border: 1.5px solid var(--border);
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input input::placeholder { color: #9aa8b8; }
.auth-input input:focus { outline: none; border-color: var(--teal, #2bb3a3); box-shadow: 0 0 0 4px rgba(43, 179, 163, 0.16); }
.auth-input input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(200, 68, 63, 0.12); }
.auth-eye {
  position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: #6b7a8c; cursor: pointer; display: grid; place-items: center;
}
.auth-eye:hover { background: #f1f5f9; }
.auth-eye:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.auth-eye svg { width: 20px; height: 20px; }
.auth-caps { display: none; font-size: 0.78rem; color: #a2560f; margin-top: 6px; }
.auth-caps.is-on { display: block; }

.auth-row { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 20px; font-size: 0.86rem; }
.auth-row a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-row a:hover { text-decoration: underline; }

.auth-submit {
  width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: 10px;
  font-family: inherit; font-size: 1.02rem; font-weight: 800; color: #fff; cursor: pointer;
  padding: 14px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, #1f8fb5 0%, var(--primary) 60%, var(--primary-dark) 100%);
  box-shadow: 0 12px 26px rgba(15, 91, 120, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}
.auth-submit:hover { filter: brightness(1.06); box-shadow: 0 16px 32px rgba(15, 91, 120, 0.36); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(43, 179, 163, 0.35), 0 12px 26px rgba(15, 91, 120, 0.32); }
.auth-submit:disabled { opacity: 0.75; cursor: progress; }
.auth-submit .tk-spinner { width: 18px; height: 18px; border-width: 2px; margin: 0; border-color: rgba(255,255,255,0.35); border-top-color: #fff; display: none; }
.auth-submit[aria-busy="true"] .tk-spinner { display: block; }
.auth-submit svg { width: 20px; height: 20px; }

.auth-help { margin-top: 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.auth-help summary { cursor: pointer; list-style: none; padding: 12px 14px; font-size: 0.88rem; font-weight: 700; color: var(--primary-dark); display: flex; align-items: center; gap: 8px; }
.auth-help summary::-webkit-details-marker { display: none; }
.auth-help summary::after { content: "+"; margin-inline-start: auto; color: var(--text-muted); font-weight: 400; font-size: 1.1rem; }
.auth-help[open] summary::after { content: "−"; }
.auth-help summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 14px; }
.auth-help ol { margin: 0 34px 14px 14px; padding: 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.8; }

.auth-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; color: var(--text-muted); }
.auth-foot a { color: var(--text-muted); }

/* status / errors (ids kept from the original page) */
.login-error {
  display: none; margin-bottom: 16px; padding: 11px 14px; border-radius: 12px; font-size: 0.88rem; font-weight: 600;
  background: #fdeceb; color: #9b2c27; border: 1px solid #f6cbc8;
}
.login-loader { display: none; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.login-loader::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--tk-teal-soft, #e5f6f3); border-top-color: var(--teal, #2bb3a3); animation: tk-spin 0.8s linear infinite; }

/* legacy (non-server) sign-in blocks — only used in local development */
.auth-legacy .form-group { margin-bottom: 14px; }
.auth-legacy .login-submit-wrap .btn { width: 100%; justify-content: center; padding: 13px; border-radius: 14px; }
.auth-legacy .login-hint { font-size: 0.8rem; color: var(--text-muted); }

/* ---------------------------------------------------------------- 3D visual side */
.auth-visual {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(700px 420px at 20% 15%, rgba(43, 179, 163, 0.45), transparent 60%),
    radial-gradient(600px 400px at 85% 85%, rgba(242, 169, 59, 0.30), transparent 60%),
    linear-gradient(150deg, #07263a 0%, #0b3d52 45%, #0f5b78 100%);
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 75%);
}
#authScene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.auth-visual__fallback {
  position: absolute; inset: 0; pointer-events: none; transition: opacity 0.8s ease;
}
.auth-visual__fallback span { position: absolute; border-radius: 50%; filter: blur(2px); animation: auth-float 9s ease-in-out infinite; }
.auth-visual__fallback span:nth-child(1) { width: 220px; height: 220px; top: 22%; left: 30%; background: radial-gradient(circle at 30% 30%, #6fe0d2, #1b8e86 60%, #0b4d5c); }
.auth-visual__fallback span:nth-child(2) { width: 120px; height: 120px; top: 58%; left: 58%; background: radial-gradient(circle at 30% 30%, #ffe0a3, #f2a93b 60%, #a8650c); animation-delay: -3s; }
.auth-visual__fallback span:nth-child(3) { width: 70px; height: 70px; top: 30%; left: 66%; background: radial-gradient(circle at 30% 30%, #fff, #a9c8d8 60%, #4a7d96); animation-delay: -6s; }
.auth-visual.is-3d .auth-visual__fallback { opacity: 0; }
@keyframes auth-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }

.auth-visual__copy { position: absolute; inset-inline: clamp(28px, 5vw, 72px); bottom: clamp(28px, 6vh, 64px); max-width: 560px; z-index: 2; }
.auth-visual__copy h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 800; line-height: 1.3; text-shadow: 0 4px 24px rgba(0,0,0,0.25); }
.auth-visual__copy p { margin-top: 10px; opacity: 0.85; font-size: 1rem; max-width: 34rem; }
.auth-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.auth-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; font-size: 0.86rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.auth-chip svg { width: 18px; height: 18px; color: #8ff0e2; }
.auth-visual__badge {
  position: absolute; top: clamp(24px, 5vh, 48px); inset-inline: clamp(28px, 5vw, 72px); z-index: 2;
  display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; opacity: 0.85;
}

/* ---------------------------------------------------------------- single-card auth pages */
.login-page:not(.auth-split) { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-page:not(.auth-split) .login-card {
  width: 100%; max-width: 460px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 24px; padding: 30px 28px 26px;
  box-shadow: 0 30px 70px rgba(11, 61, 82, 0.16), 0 2px 6px rgba(11, 61, 82, 0.06); position: relative; overflow: hidden;
}
.login-page:not(.auth-split) .login-card__accent { position: absolute; inset-inline: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--teal, #2bb3a3), var(--primary), var(--accent)); }
.login-page:not(.auth-split) .login-title { font-size: 1.45rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 6px; }
.login-page:not(.auth-split) .login-subtitle { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; margin-bottom: 18px; }
.login-page:not(.auth-split) .form-group input, .login-page:not(.auth-split) .form-group textarea { padding: 12px 14px; border-radius: 12px; }
.login-page:not(.auth-split) .login-submit-wrap .btn { width: 100%; justify-content: center; padding: 13px; border-radius: 13px; font-size: 1rem; }
.login-page:not(.auth-split) .login-hint { text-align: center; margin-top: 14px; font-size: 0.86rem; }
.login-page:not(.auth-split) .login-hint a { color: var(--primary); font-weight: 600; }
.auth-mini-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-mini-brand svg { width: 38px; height: 38px; }
.auth-mini-brand strong { font-size: 1.05rem; color: var(--primary-dark); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .login-page.auth-split { grid-template-columns: 1fr; }
  .auth-visual { order: -1; min-height: 240px; }
  .auth-visual__copy { bottom: 22px; }
  .auth-visual__copy p, .auth-chips, .auth-visual__badge { display: none; }
  .auth-visual__copy h2 { font-size: 1.35rem; }
  .auth-form-side { background: #fff; }
  .auth-main { padding: 22px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-visual__fallback span { animation: none; }
}
