/* KEEP — host-owned Kidora sign-in pages (feature 15, CP5). Loaded only by _Layout.Empty (Auth views).
   A full-viewport split screen: a navy brand panel (logo, promise, three facts) and the sign-in card. Below 992 px the
   brand panel collapses into a slim band above the card. The forms keep their ids, names and scripts. */

body.auth-page { background: var(--kd-canvas-bg); }
.kd-auth { position: fixed; inset: 0; z-index: 1050; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--kd-canvas-bg); }

/* Brand panel */
.kd-auth__brand {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
    padding: clamp(2rem, 1.2rem + 3vw, 3.75rem); color: #E8F0F8;
    background: radial-gradient(120% 90% at 0% 0%, #1B4F80 0%, transparent 55%), radial-gradient(90% 80% at 100% 100%, rgba(31, 160, 163, .35) 0%, transparent 60%), var(--kd-navy-900);
}
.kd-auth__brand::before, .kd-auth__brand::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.kd-auth__brand::before { width: 340px; height: 340px; inset-inline-end: -120px; top: 18%; border: 2px dashed rgba(255, 255, 255, .09); animation: kd-spin-slow 60s linear infinite; }
.kd-auth__brand::after { width: 180px; height: 180px; inset-inline-start: -60px; bottom: -60px; background: radial-gradient(circle, rgba(253, 138, 21, .35), transparent 70%); animation: kd-float 10s ease-in-out infinite; }
.kd-auth__brand > * { position: relative; }
.kd-auth__logo { height: 46px; width: auto; align-self: flex-start; }
.kd-auth__promise { max-width: 30rem; }
.kd-auth__promise h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 700; line-height: 1.2; color: #FFFFFF; margin: 0 0 .9rem; }
.kd-auth__promise h2 em { font-style: normal; color: #FFB55E; }
.kd-auth__promise p { color: #B9CBDD; margin: 0; font-size: 1.02rem; }
.kd-auth__facts { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: .8rem; }
.kd-auth__facts li { display: flex; align-items: center; gap: .8rem; color: #DCE7F2; }
.kd-auth__facts li span.kd-auth__fact-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #7FD6D3; }
.kd-auth__foot { font-size: var(--kd-fs-xs); color: #8EA6BF; }

/* Sign-in panel */
.kd-auth__panel { display: flex; align-items: center; justify-content: center; padding: clamp(1.5rem, 1rem + 2.5vw, 3rem) 1rem; }
.kd-auth__card { width: min(100%, 420px); animation: kd-fade-up var(--kd-dur-reveal) var(--kd-ease-out) both; }
.kd-auth__card-logo { display: none; height: 38px; width: auto; margin-bottom: 1.25rem; }
.kd-auth__title { margin: 0 0 .35rem; font-size: 1.75rem; font-weight: 700; color: var(--kd-text-heading); }
.kd-auth__subtitle { margin: 0 0 1.6rem; color: var(--kd-text-muted); }
.kd-auth .form-label { font-weight: 600; font-size: var(--kd-fs-sm); color: var(--kd-text-heading); }
.kd-auth__field { position: relative; }
.kd-auth__field > i { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); color: var(--kd-text-muted); pointer-events: none; }
.kd-auth__field .form-control { min-height: 50px; padding-inline-start: 2.6rem; border-radius: 12px; font-size: 1rem; }
.kd-auth__field .form-control:focus { border-color: var(--kd-primary); box-shadow: var(--kd-ring); }
.kd-auth__field .togglePassword { position: absolute; inset-inline-end: .35rem; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--kd-text-muted); }
.kd-auth__field .togglePassword:hover { background: var(--kd-hover); color: var(--kd-primary); }
.kd-auth__field .togglePassword:focus-visible { outline: none; box-shadow: var(--kd-ring); }
.kd-auth__field input[type="password"], .kd-auth__field input#password { padding-inline-end: 3rem; }
.kd-auth__submit { min-height: 50px; font-size: 1rem; }
.kd-auth__tools { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; padding-top: 1.1rem; border-top: 1px solid var(--kd-border); }
.kd-auth__tools > div { display: flex; align-items: center; gap: .5rem; }
.kd-auth__back { font-size: var(--kd-fs-sm); font-weight: 600; color: var(--kd-primary); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.kd-auth__back:hover { text-decoration: underline; }
.kd-auth .text-danger, .kd-auth .field-validation-error { color: var(--kd-danger) !important; }
.kd-auth .validation-summary-errors ul { margin: 0; padding-inline-start: 1.1rem; }

/* Client (phone + one-time code) sign-in: the template's dark-card styles, recoloured for the light card. */
.kd-auth .otp-box { background: var(--kd-surface); border: 1px solid var(--kd-border-strong); color: var(--kd-text-heading); font-weight: 700; transition: border-color var(--kd-dur-micro) var(--kd-ease), box-shadow var(--kd-dur-micro) var(--kd-ease); }
.kd-auth .otp-box:focus { outline: none; border-color: var(--kd-primary); box-shadow: var(--kd-ring); }
.kd-auth .ring-bg { stroke: var(--kd-slate-200); }
.kd-auth .resend-btn { color: var(--kd-text-muted); }
.kd-auth .resend-btn.enabled { color: var(--kd-teal-600); }
.kd-auth .back-btn { color: var(--kd-primary); font-weight: 600; padding: 0; }
.kd-auth .otp-header .kd-step-label { font-weight: 600; color: var(--kd-text-heading); }
.kd-auth .success-checkmark { color: var(--kd-success); }
.kd-auth .kd-otp-hint { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 1rem; padding: .75rem .9rem; border-radius: 12px; background: #EAF7F1; color: #11613F; font-size: var(--kd-fs-sm); }
.kd-auth .kd-otp-hint i { margin-top: .15rem; }

/* Header toggles (theme / language) inside the card */
.kd-auth .btn-icon-box .box-icon { border-radius: 12px; border: 1px solid var(--kd-border); background: var(--kd-surface); color: var(--kd-text-heading); min-width: 42px; height: 42px; }
.kd-auth .btn-icon-box .box-icon:hover { border-color: var(--kd-primary); background: var(--kd-hover); }

html[data-theme="dark"] .kd-auth, html[data-theme="dark"] body.auth-page { background: var(--kd-canvas-bg); }
html[data-theme="dark"] .kd-auth .kd-otp-hint { background: rgba(22, 145, 92, .15); color: #8FE0B8; }

@media (max-width: 991.98px) {
    .kd-auth { grid-template-columns: minmax(0, 1fr); align-content: start; }
    .kd-auth__brand { padding: 1.1rem 1.25rem; flex-direction: row; align-items: center; gap: 1rem; }
    .kd-auth__brand::before { display: none; }
    .kd-auth__promise p, .kd-auth__facts, .kd-auth__foot { display: none; }
    .kd-auth__promise h2 { font-size: 1rem; font-weight: 600; margin: 0; color: #DCE7F2; }
    .kd-auth__logo { height: 34px; }
    .kd-auth__panel { align-items: flex-start; }
}
@media (max-width: 420px) {
    .kd-auth__promise { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .kd-auth__brand::before, .kd-auth__brand::after { animation: none; }
}

/* ---- Feature 17 (P3): help line and the alternative sign-in; tools sized like the public header controls ---- */
.kd-auth__alt { display: grid; gap: .75rem; margin-top: 1.25rem; }
.kd-auth__help { margin: 0; font-size: var(--kd-fs-sm); color: var(--kd-text-secondary); display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; }
.kd-auth__help > i { color: var(--kd-text-muted); }
.kd-auth__help a { font-weight: 600; color: var(--kd-primary); }
.kd-auth .kd-auth__tools .btn-icon-box .box-icon { min-width: 40px; width: 40px; height: 40px; }

