/* =====================================================
   assets/css/auth-card.css
   Unified look for every guest/auth page:
   login, register, forgot/reset password, verify email,
   resend verification, login 2FA.
   All classes are prefixed fl-* so they never collide with
   Tailwind (tailwind-built.css is pre-built) or theme.css.
   ===================================================== */

:root {
    --fl-green: #28cb69;
    --fl-green-dark: #0fac4e;
    --fl-green-deep: #0c8b40;
    --fl-ink: #063b2c;            /* dark-green heading colour */
    --fl-text: #1f2937;
    --fl-muted: #6b7f78;
    --fl-field-bg: #f2fbf8;
    --fl-field-border: #a4e3cd;
    --fl-field-border-hover: #6fd3b0;
    --fl-line: #dcebe6;
}

/* ---------- guest header (matches the mock: white bar, pill buttons) ---------- */
header.sticky { box-shadow: none !important; border-bottom: 1px solid #e8f0ed !important; }
.nav-btn {
    background: #fff;
    border: 1.5px solid #d9e6e1 !important;
    border-radius: 12px !important;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none !important;
    font-size: 13px !important;
}
.nav-btn:hover { border-color: #28cb69 !important; color: #0fac4e; }
html.dark .nav-btn { background: transparent; border-color: rgba(255, 255, 255, .16) !important; }

/* ---------- page background: soft mint with big curved swooshes ---------- */
.fl-page {
    position: relative; flex: 1 1 auto; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 16px 48px;
    background:
        radial-gradient(900px 500px at 12% 0%, rgba(40, 203, 105, .10), transparent 65%),
        radial-gradient(800px 500px at 100% 100%, rgba(40, 203, 105, .10), transparent 65%),
        #f4f9f8;
    transition: background-color .3s;
}
.fl-page::before, .fl-page::after {
    content: ''; position: absolute; border-radius: 50%; pointer-events: none;
    border: 1px solid rgba(40, 203, 105, .10);
    background: linear-gradient(135deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0));
}
.fl-page::before { width: 1500px; height: 900px; left: -520px; top: 260px; transform: rotate(-14deg); }
.fl-page::after  { width: 1400px; height: 800px; right: -560px; top: -420px; transform: rotate(-18deg); }
html.dark .fl-page {
    background: #0b0b0d;
}
html.dark .fl-page::before, html.dark .fl-page::after { display: none; }

/* ---------- card ---------- */
.fl-card {
    position: relative; z-index: 2; width: 100%; max-width: 480px;
    padding: 36px 42px 34px;
    background: #fff; border-radius: 28px;
    box-shadow: 0 30px 70px -22px rgba(12, 90, 46, .20), 0 10px 24px -12px rgba(12, 90, 46, .10);
    animation: fl-in .5s cubic-bezier(.2, .8, .2, 1) both;
    transition: background-color .3s;
}
.fl-card.fl-narrow { max-width: 440px; }
html.dark .fl-card { background: #16161a; border: 1px solid #2a2a30; box-shadow: 0 25px 60px -15px rgba(0, 0, 0, .6); }
@keyframes fl-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* "Back" link (includes/auth-back-button.php) pinned to the card's top corner */
.fl-back-wrap { position: absolute; top: 28px; inset-inline-start: 34px; z-index: 5; }
.fl-back-wrap #authBackBtn { margin: 0 !important; color: var(--fl-green-dark) !important; font-size: 14px; font-weight: 600; }
.fl-back-wrap #authBackBtn:hover { color: var(--fl-green-deep) !important; }
html.dark .fl-back-wrap #authBackBtn { color: #00D99A !important; }

/* ---------- head: logo tile + title + subtitle ---------- */
.fl-head { text-align: center; margin: 0 0 24px; padding-top: 2px; }
.fl-logo {
    width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 18px;
    display: grid; place-items: center; color: #fff; font-size: 26px;
    background: linear-gradient(145deg, #22c98f 0%, #0fac4e 100%);
    box-shadow: 0 12px 24px -8px rgba(15, 172, 78, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.fl-logo.fl-logo-red { background: linear-gradient(145deg, #f87171, #dc2626); box-shadow: 0 12px 24px -8px rgba(220, 38, 38, .5); }
.fl-title { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 600; color: var(--fl-ink); letter-spacing: -.3px; }
.fl-sub { margin: 8px 0 0; font-size: 14.5px; color: var(--fl-muted); }
html.dark .fl-title { color: #fff; }
html.dark .fl-sub { color: #94A3AE; }

/* ---------- form ---------- */
.fl-form { display: flex; flex-direction: column; gap: 16px; }
.fl-label { display: block; margin: 0 0 7px; font-size: 14px; font-weight: 600; color: var(--fl-ink); }
html.dark .fl-label { color: #d1d5db; }

.fl-field { position: relative; }
.fl-ico {
    position: absolute; top: 50%; inset-inline-start: 16px; transform: translateY(-50%);
    font-size: 15px; color: var(--fl-green-dark); pointer-events: none; transition: color .2s;
}
.fl-input {
    width: 100%; height: 50px; box-sizing: border-box;
    padding-block: 0; padding-inline: 46px 16px;
    border: 1.5px solid var(--fl-field-border); border-radius: 16px;
    background: var(--fl-field-bg); color: var(--fl-text);
    font-size: 14.5px; font-family: inherit; outline: none;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.fl-input::placeholder { color: #93a8a1; }
.fl-input.fl-pw { padding-inline-end: 48px; }
.fl-input.fl-ltr { direction: ltr; text-align: start; }
.fl-input:hover { border-color: var(--fl-field-border-hover); }
.fl-input:focus { border-color: var(--fl-green); background: #fff; box-shadow: 0 0 0 4px rgba(40, 203, 105, .16); }
.fl-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--fl-field-bg) inset; -webkit-text-fill-color: var(--fl-text); }
html.dark .fl-input { background: #121216; border-color: #2a2a30; color: #F1F5F5; }
html.dark .fl-input:hover { border-color: #3a3a42; }
html.dark .fl-input:focus { background: #121216; border-color: #00D99A; box-shadow: 0 0 0 4px rgba(0, 217, 154, .18); }
html.dark .fl-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #121216 inset; -webkit-text-fill-color: #fff; }
html.dark .fl-ico { color: #00D99A; }

.fl-eye {
    position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; background: transparent; border-radius: 10px;
    display: grid; place-items: center; font-size: 15px; color: var(--fl-green-dark); cursor: pointer;
    transition: background .2s;
}
.fl-eye:hover { background: rgba(40, 203, 105, .12); }
html.dark .fl-eye { color: #00D99A; }

.fl-caps { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; font-weight: 600; color: #b45309; }
.fl-caps[hidden] { display: none; }
html.dark .fl-caps { color: #fbbf24; }

.fl-captcha { display: block; width: 100%; max-width: 100%; overflow: visible; min-height: 65px; }
.fl-captcha .cf-turnstile,
.fl-captcha .cf-turnstile iframe { display: block; width: 100% !important; max-width: 100% !important; }
.fl-captcha .g-recaptcha { display: flex; justify-content: center; }

.fl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fl-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #374151; cursor: pointer; user-select: none; }
.fl-check input { width: 18px; height: 18px; accent-color: var(--fl-green); cursor: pointer; margin: 0; border-radius: 5px; }
html.dark .fl-check { color: #d1d5db; }
.fl-link { font-size: 14px; font-weight: 600; color: var(--fl-green-dark); text-decoration: none; }
.fl-link:hover { text-decoration: underline; }
html.dark .fl-link { color: #00D99A; }

/* ---------- primary button ---------- */
.fl-btn {
    position: relative; width: 100%; height: 54px; border: 0; border-radius: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-weight: 600; font-size: 16px; font-family: inherit; color: #fff; text-decoration: none;
    background: linear-gradient(90deg, #10bc7d 0%, #0d9a68 55%, #08805a 100%);
    box-shadow: 0 14px 26px -10px rgba(15, 172, 78, .65);
    transition: transform .15s, box-shadow .15s, opacity .15s, filter .15s;
}
.fl-btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 18px 30px -10px rgba(15, 172, 78, .7); }
.fl-btn:active { transform: translateY(0); }
.fl-btn:disabled { cursor: progress; opacity: .85; transform: none; filter: none; }
.fl-btn.fl-inline { display: inline-flex; width: auto; padding: 0 34px; }
.fl-btn i { font-size: 15px; }
[dir="rtl"] .fl-btn .fl-arrow { transform: scaleX(-1); }
.fl-spin {
    display: none; width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
    animation: fl-rot .7s linear infinite;
}
.fl-btn.is-loading .fl-spin { display: inline-block; }
.fl-btn.is-loading .fl-arrow { display: none; }
@keyframes fl-rot { to { transform: rotate(360deg); } }

/* ---------- or / google / footer text ---------- */
.fl-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.fl-or i { flex: 1; height: 1px; background: var(--fl-line); }
.fl-or span { font-size: 13px; font-weight: 600; color: #8aa098; }
html.dark .fl-or i { background: rgba(255, 255, 255, .12); }

.fl-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 52px; border: 1.5px solid #c0ecdf; border-radius: 16px; background: #fff;
    font-size: 15px; font-weight: 600; color: #1f2937; text-decoration: none;
    transition: background-color .2s, border-color .2s, transform .15s;
}
.fl-google:hover { background: #f2fbf8; border-color: #6fd3b0; transform: translateY(-1px); }
.fl-google svg { width: 21px; height: 21px; flex: none; }
html.dark .fl-google { background: transparent; border-color: rgba(255, 255, 255, .16); color: #e5e7eb; }
html.dark .fl-google:hover { background: rgba(255, 255, 255, .06); }

.fl-foot { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--fl-muted); }
.fl-foot a { color: var(--fl-green-dark); font-weight: 600; text-decoration: none; }
.fl-foot a:hover { text-decoration: underline; }
html.dark .fl-foot { color: #94A3AE; }
html.dark .fl-foot a { color: #00D99A; }

/* ---------- alerts ---------- */
.fl-alert { border: 1px solid; border-radius: 14px; padding: 12px 14px; font-size: 13.5px; margin: 0 0 16px; line-height: 1.55; }
.fl-alert.err { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.fl-alert.ok  { background: #eefcf3; color: #0c8b40; border-color: #aeeec8; }
.fl-alert.center { text-align: center; }
.fl-alert ul { margin: 0; padding-inline-start: 1.1rem; list-style: disc; display: grid; gap: 4px; }
.fl-alert a.fl-alert-link { display: block; margin-top: 8px; font-weight: 600; text-align: center; color: inherit; }
html.dark .fl-alert.err { background: rgba(127, 29, 29, .22); color: #fca5a5; border-color: rgba(248, 113, 113, .35); }
html.dark .fl-alert.ok  { background: rgba(12, 90, 46, .3); color: #78e0a0; border-color: rgba(72, 213, 129, .35); }

/* ---------- 2FA code input ---------- */
.fl-code { text-align: center; font-size: 28px; font-weight: 600; letter-spacing: .5em; padding-inline: 16px 8px; height: 60px; }
.fl-ghost {
    width: 100%; background: none; border: 0; cursor: pointer; padding: 8px;
    font: 700 13.5px/1 inherit; font-family: inherit; color: var(--fl-muted); transition: color .2s;
}
.fl-ghost:hover { color: var(--fl-green-dark); }

/* ---------- register: password strength + match hints (used by inline JS) ---------- */
.rg-hint { display: flex; align-items: center; gap: 10px; margin-top: -6px; padding-inline: 4px; font-size: 12px; font-weight: 600; color: #6b7280; }
.rg-hint[hidden] { display: none; }
.rg-bars { display: flex; gap: 4px; flex: 0 0 104px; }
.rg-bars i { flex: 1; height: 4px; border-radius: 4px; background: #dcebe6; transition: background-color .25s; }
html.dark .rg-bars i { background: rgba(255, 255, 255, .14); }
#rgStrength[data-level="1"] .rg-bars i:nth-child(-n+1) { background: #ef4444; }
#rgStrength[data-level="2"] .rg-bars i:nth-child(-n+2) { background: #f59e0b; }
#rgStrength[data-level="3"] .rg-bars i:nth-child(-n+3) { background: #48d581; }
#rgStrength[data-level="4"] .rg-bars i:nth-child(-n+4) { background: #0fac4e; }
#rgStrength[data-level="1"] .rg-hint-text { color: #ef4444; }
#rgStrength[data-level="2"] .rg-hint-text { color: #d97706; }
#rgStrength[data-level="3"] .rg-hint-text { color: #28cb69; }
#rgStrength[data-level="4"] .rg-hint-text { color: #0fac4e; }
#rgMatch.ok  { color: #0fac4e; }
#rgMatch.bad { color: #ef4444; }
html.dark #rgMatch.ok { color: #00D99A; }
.fl-shake { animation: fl-shake .4s; }
@keyframes fl-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.fl-success { text-align: center; }
.fl-success .fl-check-badge {
    width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
    background: linear-gradient(145deg, #22c98f, #0fac4e); color: #fff; font-size: 24px;
    animation: fl-pop .5s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
@keyframes fl-pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 480px) {
    .fl-card { padding: 30px 20px 26px; border-radius: 24px; }
    .fl-back-wrap { top: 22px; inset-inline-start: 20px; }
    .fl-title { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    .fl-card, .fl-btn, .fl-google, .fl-input { animation: none !important; transition: none !important; }
}

/* Terms checkbox on the sign-up form */
.rg-terms { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--fl-ink); cursor: pointer; }
.rg-terms input { margin-top: 3px; width: 17px; height: 17px; flex: 0 0 auto; accent-color: #0fac4e; }
.rg-terms a { color: #0fac4e; font-weight: 600; text-decoration: underline; }
html.dark .rg-terms { color: #d1d5db; }
