/* ============ My Day — sign in / sign up / password pages ============ */
.auth-body { background: #f5f6fb; min-height: 100vh; }
.auth-shell { display: flex; min-height: 100vh; }

/* ----- Brand side ----- */
.auth-side {
    position: relative; overflow: hidden;
    flex: 1 1 52%; max-width: 760px;
    background: radial-gradient(1200px 600px at 10% 0%, #6366f1 0%, #4338ca 35%, #312e81 70%, #1e1b4b 100%);
    color: #fff; padding: 48px 56px;
    align-items: center;
}
.auth-side-inner { position: relative; z-index: 2; width: 100%; max-width: 560px; margin: 0 auto; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: 1; animation: float 14s ease-in-out infinite; }
.blob.b1 { width: 340px; height: 340px; background: #f59e0b; top: -80px; inset-inline-end: -60px; opacity: .35; }
.blob.b2 { width: 300px; height: 300px; background: #ec4899; bottom: -60px; inset-inline-start: -60px; animation-delay: -4s; opacity: .35; }
.blob.b3 { width: 260px; height: 260px; background: #14b8a6; top: 45%; inset-inline-start: 55%; animation-delay: -8s; opacity: .25; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(20px, -24px) scale(1.06); } }

.auth-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 1.3rem; }
.auth-brand small { display: block; font-family: "Cairo", sans-serif; font-weight: 600; font-size: .8rem; opacity: .75; line-height: 1; }
.auth-brand:hover { color: #fff; }
.auth-brand-sm { color: var(--text); font-size: 1.1rem; }
.auth-brand-sm:hover { color: var(--text); }

.auth-headline { font-size: 2.6rem; font-weight: 800; line-height: 1.15; margin: 36px 0 12px; letter-spacing: -.02em; }
body.rtl .auth-headline { letter-spacing: 0; }
.auth-sub { font-size: 1.08rem; opacity: .82; max-width: 470px; }

/* Preview cards */
.preview { position: relative; height: 270px; margin: 60px 0 26px; }
.pv-card {
    background: rgba(255, 255, 255, .96); color: #0f172a; border-radius: 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
}
.pv-main { position: absolute; inset-inline-start: 0; top: 10px; width: 330px; padding: 16px 18px; }
.pv-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.pv-dot { width: 10px; height: 10px; border-radius: 50%; }
.pv-pill { margin-inline-start: auto; font-size: .72rem; background: #eef2ff; color: #4f46e5; padding: 2px 8px; border-radius: 99px; }
.pv-row { display: flex; align-items: center; gap: 8px; font-size: .86rem; padding: 7px 0; border-bottom: 1px solid #f1f5f9; }
.pv-row i { color: #cbd5e1; }
.pv-row.done { color: #94a3b8; text-decoration: line-through; }
.pv-row.done i { color: #22c55e; }
.pv-tag { margin-inline-start: auto; font-size: .68rem; padding: 1px 8px; border-radius: 99px; font-weight: 600; }
.pv-tag.red { background: #fee2e2; color: #b91c1c; }
.pv-bar { height: 6px; background: #eef0f6; border-radius: 99px; margin-top: 12px; overflow: hidden; }
.pv-bar span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #14b8a6); border-radius: 99px; }
.pv-float { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; animation: bob 6s ease-in-out infinite; }
.pv-a { inset-inline-start: 300px; top: -48px; animation-delay: -1s; }
.pv-b { inset-inline-start: 330px; top: 110px; animation-delay: -3s; }
.pv-c { inset-inline-start: 250px; top: 205px; animation-delay: -5s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pv-ico { width: 34px; height: 34px; border-radius: 10px; color: #fff; display: grid; place-items: center; }
.pv-k { font-size: .7rem; color: #64748b; font-weight: 600; }
.pv-v { font-weight: 800; font-size: .95rem; }

.auth-features { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.auth-features li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; opacity: .92; }
.auth-features i { color: #fbbf24; font-size: 1.1rem; margin-top: 1px; }
.auth-trust { display: inline-flex; gap: 8px; align-items: center; font-size: .82rem; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); padding: 8px 14px; border-radius: 99px; }

/* ----- Form side ----- */
.auth-main { flex: 1 1 48%; display: flex; flex-direction: column; min-height: 100vh; padding: 22px 28px; }
.auth-topbar { display: flex; align-items: center; }
.lang-btn {
    border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 99px;
    padding: 6px 14px; font-weight: 600; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.auth-card { width: 100%; max-width: 460px; margin: auto; padding: 28px 0; }
.auth-footer { text-align: center; font-size: .78rem; color: var(--muted); }

.auth-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
body.rtl .auth-title { letter-spacing: 0; }
.auth-lead { color: var(--muted); margin-bottom: 26px; }
.auth-icon-lg {
    width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 1.9rem;
    background: var(--brand-soft); color: var(--brand); margin-bottom: 18px;
}
.auth-icon-lg.success { background: #dcfce7; color: #16a34a; }
.auth-icon-lg.mail { background: #fef3c7; color: #d97706; }

/* Inputs with icons */
.field { margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .85rem; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.field label a { font-weight: 600; font-size: .82rem; }
.input-icon { position: relative; }
.input-icon > i.lead-icon {
    position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px;
    color: #94a3b8; font-size: 1.05rem; pointer-events: none;
}
.input-icon .form-control {
    height: 50px; padding-inline-start: 42px; border-radius: 12px; border: 1.5px solid var(--border);
    background: #fff; font-size: .98rem;
}
.input-icon .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.input-icon .form-control.input-validation-error { border-color: #ef4444; }
.input-icon .form-control.has-toggle { padding-inline-end: 46px; }
.pw-toggle {
    position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 8px;
    border: 0; background: transparent; color: #64748b; width: 36px; height: 36px; border-radius: 8px;
}
.pw-toggle:hover { background: #f1f5f9; color: var(--brand); }
.field-error { color: #dc2626; font-size: .8rem; margin-top: 4px; display: block; }
.caps-warn { display: none; color: #b45309; font-size: .8rem; margin-top: 4px; }
.caps-warn.show { display: block; }

/* Password strength */
.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter span { flex: 1; height: 5px; border-radius: 99px; background: #e2e8f0; transition: background .2s; }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: #ef4444; }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: #f59e0b; }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: #84cc16; }
.pw-meter[data-score="4"] span:nth-child(-n+4) { background: #22c55e; }
.pw-label { font-size: .75rem; color: var(--muted); margin-top: 4px; min-height: 1em; }
.pw-rules { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); }
.pw-rules li { display: flex; gap: 4px; align-items: center; }
.pw-rules li .yes { display: none; }
.pw-rules li.ok { color: #16a34a; }
.pw-rules li.ok .yes { display: inline; }
.pw-rules li.ok .no { display: none; }
.match-ok { color: #16a34a; font-size: .8rem; display: none; margin-top: 4px; }
.match-ok.show { display: block; }

/* Big submit */
.btn-auth {
    height: 52px; border-radius: 12px; font-weight: 700; font-size: 1rem; width: 100%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0; color: #fff;
    box-shadow: 0 10px 24px rgba(79, 70, 229, .3); transition: transform .1s, box-shadow .2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-auth:hover { color: #fff; box-shadow: 0 12px 28px rgba(79, 70, 229, .4); transform: translateY(-1px); }
.btn-auth:disabled { opacity: .75; transform: none; }
.btn-auth .spinner-border { width: 1.1rem; height: 1.1rem; border-width: .15em; display: none; }
.btn-auth.loading .spinner-border { display: inline-block; }
.btn-auth.loading .btn-text { opacity: .85; }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-switch { text-align: center; color: var(--muted); margin-top: 22px; }
.auth-switch a { font-weight: 700; }

/* Choice cards (new household / join) */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice label {
    display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px solid var(--border); border-radius: 14px;
    cursor: pointer; background: #fff; height: 100%; transition: border-color .15s, box-shadow .15s;
}
.choice label i { font-size: 1.3rem; color: var(--brand); }
.choice label b { font-size: .92rem; }
.choice label span { font-size: .76rem; color: var(--muted); }
.choice input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); background: #fafaff; }
.choice input:focus-visible + label { outline: 2px solid var(--brand); }

/* Segmented language picker */
.segmented { display: inline-flex; background: #eef0f6; border-radius: 12px; padding: 4px; gap: 4px; width: 100%; }
.segmented input { display: none; }
.segmented label { flex: 1; text-align: center; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); margin: 0; }
.segmented input:checked + label { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }

/* Steps on register */
.steps { display: flex; gap: 8px; margin-bottom: 22px; }
.steps .st { flex: 1; height: 5px; border-radius: 99px; background: #e2e8f0; }
.steps .st.on { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.step-pane { display: none; animation: fadeIn .25s ease; }
.step-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.auth-alert { border-radius: 12px; border: 0; font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.auth-alert ul { margin: 0; padding-inline-start: 16px; }
.validation-summary-valid { display: none; }

.hint-box { background: #f8fafc; border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; font-size: .84rem; color: var(--muted); display: flex; gap: 10px; }
.hint-box i { color: var(--brand); font-size: 1.1rem; }

.dev-link { word-break: break-all; font-size: .8rem; }

@media (max-width: 991.98px) {
    .auth-main { padding: 16px 18px; }
    .auth-card { padding: 18px 0 28px; }
    .auth-title { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .blob, .pv-float { animation: none; }
}

/* Cloudflare Turnstile (only rendered when the keys are set) */
.turnstile-box { margin: 4px 0 16px; min-height: 65px; display: flex; justify-content: center; }
.turnstile-box .cf-turnstile { width: 100%; }

.auth-legal-links { text-align: center; margin-top: 18px; font-size: .82rem; color: #64748b; }
.auth-legal-links a { color: #64748b; margin: 0 6px; }
