.chiki-auth { box-sizing:border-box; width:min(450px,calc(100% - 28px)); max-height:calc(100dvh - 36px); padding:22px; margin:auto; border:1px solid #e2e8f0; border-radius:22px; background:#fffefa; color:#202438; box-shadow:0 25px 90px #18213830; overflow:auto; font:14px/1.6 'Plus Jakarta Sans',Arial,sans-serif }
.chiki-auth *, .chiki-auth *::before { box-sizing:border-box }
.chiki-auth::backdrop { background:#17203680; backdrop-filter:blur(4px) }
body.chiki-auth-open { overflow:hidden }
.chiki-auth [hidden] { display:none!important }
.chiki-auth-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px }
.chiki-auth-brand { font-family:'Fredoka',sans-serif; color:#1d22df; font-size:25px; font-weight:600; letter-spacing:-.7px }
.chiki-auth-header button { display:grid; place-items:center; flex:none; width:40px; height:40px; padding:0; border:0; background:transparent; color:#64748b; cursor:pointer }
.chiki-auth-header button svg { display:block; width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round }
.chiki-auth-header button:hover { color:#1d22df }
.chiki-auth[data-mode=register] #chikiGoogleHint { display:none }
.chiki-auth h2 { font:800 26px/1.3 'Plus Jakarta Sans',Arial,sans-serif; color:#202438; letter-spacing:-1px; margin:0 }
.chiki-auth-intro { font-size:12px; color:#718096; margin:4px 0 12px }
.chiki-auth-tabs { display:flex; padding:4px; background:#f1f3f8; border-radius:10px; gap:4px; margin-bottom:12px }
.chiki-auth-tabs button { flex:1; border:0; border-radius:7px; padding:9px; font-family:inherit; font-size:12px; font-weight:600; background:transparent; cursor:pointer; color:#68758b }
.chiki-auth-tabs [aria-pressed=true] { background:#fff; color:#1d22df; box-shadow:0 1px 5px #1e293b0a }
.chiki-google { display:flex; justify-content:center; min-height:44px }
.chiki-auth-divider { display:flex; align-items:center; gap:12px; margin:10px 0; font-size:11px; color:#8b96a7 }
.chiki-auth-divider::before,.chiki-auth-divider::after { content:''; flex:1; height:1px; background:#e2e8f0 }
.chiki-auth label { display:block; font-size:11px; font-weight:600; margin-bottom:10px; color:#46536b }
.chiki-auth input:not([type=checkbox]) { display:block; width:100%; min-height:42px; padding:9px 12px; margin-top:6px; border:1px solid #e2e8f0; border-radius:10px; background:white; color:#202438; font:inherit; font-size:14px }
.chiki-auth input:focus-visible,.chiki-auth button:focus-visible { outline:3px solid #bec0ff; outline-offset:2px }
/* Required asterisk */
.chiki-required { color:#e53e3e; margin-left:2px; font-weight:700 }
/* Phone row */
.chiki-phone-row { position:relative; margin-bottom:10px }
.chiki-auth .chiki-phone-row>label { margin:0 0 6px }
.chiki-phone-inputs { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:stretch; gap:8px }
.chiki-auth .chiki-phone-inputs input { min-width:0; margin:0 }
.chiki-country-button { display:flex; align-items:center; gap:6px; padding:9px 10px; border:1px solid #e2e8f0; border-radius:10px; background:#fff; color:#202438; font:600 13px 'Plus Jakarta Sans',Arial,sans-serif; cursor:pointer }
.chiki-country-button:hover,.chiki-country-button[aria-expanded=true] { border-color:#1d22df; background:#f8f8ff }
.chiki-country-button img,.chiki-country-option img { flex:none; width:24px; height:17px; object-fit:cover; border-radius:2px }
/* Beautiful SVG chevron arrow */
.chiki-country-chevron { display:block; flex:none; width:14px; height:14px; color:#64748b; transition:transform .2s }
.chiki-country-button[aria-expanded=true] .chiki-country-chevron { transform:rotate(180deg); color:#1d22df }
.chiki-country-panel { position:absolute; z-index:5; top:calc(100% + 6px); left:0; right:0; padding:10px; border:1px solid #e2e8f0; border-radius:12px; background:#fff; box-shadow:0 10px 30px #18213820 }
.chiki-auth .chiki-country-panel input { margin:0 0 6px; min-width:0; font-size:12px }
.chiki-country-list { max-height:176px; overflow-y:auto; overscroll-behavior:contain }
.chiki-country-option { display:flex; align-items:center; gap:8px; width:100%; padding:10px 6px; border:0; border-radius:6px; background:#fff; color:#202438; text-align:left; font:500 12px 'Plus Jakarta Sans',Arial,sans-serif; cursor:pointer }
.chiki-country-option span:first-of-type { flex:1; min-width:0; overflow-wrap:anywhere }
.chiki-country-option span:last-of-type { flex:none; color:#64748b }
.chiki-country-option:hover,.chiki-country-option[aria-pressed=true] { background:#f0f1ff; color:#1d22df }
/* Password visibility toggle */
.chiki-password-field { position:relative; display:block }
.chiki-auth .chiki-password-field input { padding-right:44px }
.chiki-password-toggle { position:absolute; inset:0 2px 0 auto; display:grid; place-items:center; width:40px; padding:0; border:0; border-radius:8px; background:transparent; color:#64748b; cursor:pointer }
.chiki-password-toggle:hover { color:#1d22df }
.chiki-password-toggle svg { display:block; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round }
.chiki-eye-slash { display:none }
.chiki-password-toggle[aria-pressed=true] .chiki-eye-slash { display:block }
.chiki-password-match { margin:0 0 8px; font-size:11px; font-weight:600 }
.chiki-password-match[data-state=match] { color:#15803d }
.chiki-password-match[data-state=mismatch] { color:#b91c1c }
.chiki-auth input.chiki-password-match-ok { border-color:#15803d; background:#f0fdf4 }
.chiki-auth input.chiki-password-match-error { border-color:#b91c1c; background:#fff7f7 }
/* Checkboxes */
.chiki-auth .chiki-auth-check { display:flex; gap:9px; align-items:flex-start; font-weight:400; font-size:11px }
.chiki-auth .chiki-auth-check input { appearance:auto; accent-color:#1d22df; width:16px; height:16px; min-height:16px; padding:0; margin:2px 0 0; flex:none }
.chiki-auth-check span { min-width:0 }
.chiki-auth-check a { color:#1d22df; text-decoration:underline }
/* Error states */
.chiki-auth-error { padding:12px; border-radius:9px; border:1px solid #f1d2c5; background:#fff5f0; color:#944c31; font-size:12px; overflow-wrap:anywhere }
.chiki-auth-hint { color:#768399; font-size:11px; margin:6px 0 10px }
/* Field-level validation error */
.chiki-auth label.chiki-field-error,
.chiki-auth .chiki-phone-row.chiki-field-error > label { color:#c53030 }
.chiki-auth label.chiki-field-error input:not([type=checkbox]),
.chiki-auth .chiki-phone-row.chiki-field-error .chiki-phone-inputs input,
.chiki-auth .chiki-phone-row.chiki-field-error .chiki-country-button { border-color:#e53e3e; background:#fff5f5 }
.chiki-auth label.chiki-field-error.chiki-auth-check { color:#c53030 }
.chiki-auth label.chiki-field-error.chiki-auth-check input[type=checkbox] { outline:2px solid #e53e3e; border-radius:2px }
/* Spacing before submit button — wrap actions */
.chiki-auth-actions { margin-top:20px; display:flex; flex-direction:column; gap:0 }
/* Submit & link buttons */
.chiki-auth-submit { width:100%; min-height:45px; padding:12px; border:0; border-radius:10px; color:white; background:#1d22df; font:700 13px 'Plus Jakarta Sans',Arial,sans-serif; cursor:pointer; transition:background .15s }
.chiki-auth-submit:hover { background:#151abf }
.chiki-auth button:disabled { opacity:.55; cursor:wait }
.chiki-auth-link { display:block; margin:10px auto 0; padding:0; border:0; background:transparent; color:#626f89; font:inherit; font-size:11px; cursor:pointer }
@media(max-width:420px) { .chiki-auth { padding:18px } .chiki-auth h2 { font-size:26px } }

.login-brand>a { font-family:'Fredoka',sans-serif; font-weight:600 }
@media(max-height:640px) {
 .chiki-auth[data-mode=register] h2 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%) }
 .chiki-auth[data-mode=register] #chikiPasswordHint { display:none }
 .chiki-auth[data-mode=register] label { margin-bottom:6px; line-height:1.4 }
 .chiki-auth[data-mode=register] input:not([type=checkbox]) { min-height:38px; padding:7px 10px; margin-top:4px }
 .chiki-auth[data-mode=register] .chiki-password-field input { padding-right:44px }
 .chiki-auth[data-mode=register] .chiki-auth-divider { margin-block:6px }
 .chiki-auth[data-mode=register] .chiki-auth-submit { min-height:40px; padding:9px }
}
@media(max-height:740px) {
 .chiki-auth { padding:16px 20px; max-height:calc(100dvh - 20px) }
 .chiki-auth-header { margin-bottom:8px }
 .chiki-auth h2 { font-size:24px }
 .chiki-auth-intro { display:none }
 .chiki-auth-tabs { margin-top:10px; margin-bottom:10px }
 .chiki-auth label { margin-bottom:8px }
 .chiki-auth[data-mode=register] #chikiPasswordHelp { display:none }
}
#chikiOtpRow h3 { margin:12px 0 6px; font-size:18px }
#chikiCaptchaRow { margin:10px 0; max-width:100% }
#chikiOtp { letter-spacing:.35em; font-variant-numeric:tabular-nums }
/* Horizontal reCAPTCHA and six-digit SMS verification. */
#chikiCaptchaFrame { width:100%; max-width:304px; height:78px; margin:0 0 14px; overflow:hidden }
#chikiCaptcha { width:304px; height:78px; transform-origin:top left }
.chiki-auth[data-otp=true] .chiki-auth-intro { display:none }
.chiki-auth[data-otp=true] #chikiAuthTitle { position:static; width:auto; height:auto; overflow:visible; clip-path:none; text-align:center; margin-bottom:6px }
.chiki-auth[data-otp=true] .chiki-auth-actions { margin-top:4px }
#chikiOtpRow { text-align:center; padding:8px 0 2px }
#chikiOtpRow h3 { display:none }
.chiki-otp-label { color:#64748b; font-size:12px; margin:16px 0 10px }
.chiki-otp-digits { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; margin:0 0 12px }
.chiki-auth #chikiOtpDigits input { min-width:0; width:100%; height:52px; min-height:52px; margin:0; padding:0; border:1px solid #e2e8f0; border-radius:12px; background:#fff; color:#202438; font:600 23px/1 'Plus Jakarta Sans',Arial,sans-serif; text-align:center; letter-spacing:0; outline:none; box-shadow:none; transition:border-color .15s }
.chiki-auth #chikiOtpDigits input:focus { border:2px solid #1d22df; outline:none; box-shadow:none; background:#fff }
.chiki-auth #chikiOtpDigits.is-error input { color:#c53030; border-color:#c53030; background:#fff }
.chiki-otp-status { min-height:18px; margin:0 0 12px; color:#64748b; font-size:12px }
.chiki-otp-digits.is-error + input + .chiki-otp-status { color:#c53030 }
.chiki-auth #chikiOtpConfirm { display:flex; align-items:center; justify-content:center; gap:9px; background:#1d22df; color:#fff; opacity:1 }
#chikiOtpConfirm svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round }
@media(max-width:360px) { .chiki-otp-digits { gap:6px } .chiki-auth #chikiOtpDigits input { height:46px; min-height:46px; font-size:21px; border-radius:10px } }
/* Keep Google challenge portals above this custom modal layer. */
.chiki-auth-shade { position:fixed; inset:0; z-index:10000; background:#17203680; backdrop-filter:blur(4px) }
.chiki-auth-shade[hidden] { display:none!important }
.chiki-auth[open] { position:fixed; z-index:10001; inset:auto; top:50%; left:50%; transform:translate(-50%,-50%); margin:0 }
#chikiCaptchaRow { text-align:center }
#chikiCaptchaFrame { width:min(100%,258.4px); height:66.3px; margin:0 auto 14px }
#chikiOtpResend,#chikiOtpBack { min-height:44px; padding:10px 14px; margin:8px auto 0; font-size:14px; font-weight:600; line-height:1.5 }
#chikiOtpBack { color:#1d22df }
#chikiOtpResend:not(:disabled):hover,#chikiOtpBack:hover { text-decoration:underline; text-underline-offset:3px }
/* Firebase's branding belongs to its SMS step, never a floating corner overlay. */
#chikiSmsVerifier { display:flex; justify-content:center; margin:8px auto 14px; max-width:100% }
#chikiSmsVerifier[hidden] { display:none!important }
#chikiSmsVerifier .grecaptcha-badge { position:static!important; margin:0 auto }
