/* ══════════════════════════════════════════════════════════
   CandidHub · Premium Animated Auth Theme
   Shared by: index.php (login), register (+ OTP),
   forgot_password, reset_password  — candidate & admin.
   Pure CSS: animated aurora + floating blobs, glass card.
   No markup changes — keeps each page's structure intact.
══════════════════════════════════════════════════════════ */

/* ---- Animated aurora backdrop (dark premium) ---- */
body {
    min-height: 100vh; margin: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; box-sizing: border-box;
    position: relative; overflow: hidden;
    background-color: #070E1C !important;
    background-image:
        radial-gradient(60rem 60rem at 15% 8%,  rgba(0,150,255,.20), transparent 60%),
        radial-gradient(55rem 55rem at 85% 18%, rgba(124,58,237,.18), transparent 60%),
        radial-gradient(50rem 50rem at 50% 105%, rgba(0,212,255,.16), transparent 60%) !important;
    background-size: 200% 200% !important;
    background-attachment: fixed;
    animation: authAurora 20s ease-in-out infinite alternate;
}
@keyframes authAurora {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 100%; }
}

/* ---- Four floating blobs (body + html pseudo-elements) ---- */
body::before, body::after {
    content: ''; position: fixed; border-radius: 50%;
    pointer-events: none; z-index: 0; filter: blur(30px);
    inset: auto !important;
}
body::before {
    width: 420px; height: 420px;
    top: -100px !important; left: -80px !important;
    background: radial-gradient(circle, rgba(0,212,255,.35), transparent 70%) !important;
    animation: blobFloat1 16s ease-in-out infinite;
}
body::after {
    width: 480px; height: 480px;
    bottom: -150px !important; right: -110px !important;
    background: radial-gradient(circle, rgba(124,58,237,.30), transparent 70%) !important;
    animation: blobFloat2 21s ease-in-out infinite;
}
html::before, html::after {
    content: ''; position: fixed; border-radius: 50%;
    pointer-events: none; z-index: 0; filter: blur(42px);
}
html::before {
    width: 300px; height: 300px; top: 38%; right: 10%;
    background: radial-gradient(circle, rgba(0,132,255,.22), transparent 70%);
    animation: blobFloat3 24s ease-in-out infinite;
}
html::after {
    width: 260px; height: 260px; bottom: 16%; left: 8%;
    background: radial-gradient(circle, rgba(16,185,129,.18), transparent 70%);
    animation: blobFloat4 26s ease-in-out infinite;
}
@keyframes blobFloat1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,44px) scale(1.15); } }
@keyframes blobFloat2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-52px,-40px) scale(1.1); } }
@keyframes blobFloat3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-44px,32px); } }
@keyframes blobFloat4 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(34px,-30px); } }

/* ---- Glass card + entrance animation ---- */
.auth-card, .login-card {
    position: relative; z-index: 2;
    background: rgba(255,255,255,.94) !important;
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    border: 1px solid rgba(255,255,255,.65) !important;
    border-radius: 24px !important;
    box-shadow: 0 30px 70px rgba(2,8,20,.55), inset 0 1px 0 rgba(255,255,255,.6) !important;
    animation: authCardIn .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes authCardIn {
    0%   { opacity: 0; transform: translateY(26px) scale(.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Floating brand icon ---- */
.auth-brand-icon, .login-brand-icon {
    display: inline-block;
    animation: authFloat 4s ease-in-out infinite;
}
@keyframes authFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---- Softer inputs inside auth cards ---- */
.auth-card .form-control, .login-card .form-control { border-radius: 12px; }

/* ---- Animated sheen sweep across the primary button ---- */
.btn-auth { position: relative; overflow: hidden; }
.btn-auth::after {
    content: ''; position: absolute; top: 0; left: -130%;
    width: 60%; height: 100%; pointer-events: none;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.38), transparent);
    transform: skewX(-20deg);
    animation: authSheen 5s ease-in-out infinite;
}
@keyframes authSheen { 0%,55% { left: -130%; } 100% { left: 140%; } }

/* ---- Respect users who prefer reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    body, .auth-card, .login-card,
    .auth-brand-icon, .login-brand-icon,
    body::before, body::after, html::before, html::after,
    .btn-auth::after { animation: none !important; }
}

/* ══════════════════════════════════════════════════════════
   INTERACTIONS · press, ripple, submit-loading
══════════════════════════════════════════════════════════ */

/* Tactile press-down */
.btn-auth,
.auth-card .btn, .login-card .btn {
    transition: transform .12s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, filter .2s ease;
}
.btn-auth:active,
.auth-card .btn:active, .login-card .btn:active {
    transform: translateY(1px) scale(.98);
}

/* Ripple (span injected by auth.js) */
.auth-card .btn, .login-card .btn { position: relative; overflow: hidden; }
.rce-ripple {
    position: absolute; border-radius: 50%;
    transform: scale(0); pointer-events: none;
    background: rgba(255,255,255,.5);
    animation: rceRipple .6s ease-out forwards;
}
@keyframes rceRipple { to { transform: scale(2.6); opacity: 0; } }

/* Submit loading state — label hides, spinner shows */
.btn-auth.is-loading { color: transparent !important; pointer-events: none; }
.btn-auth.is-loading::before {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 20px; height: 20px; margin: -10px 0 0 -10px;
    border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: authSpin .6s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .rce-ripple { animation: none !important; display: none !important; }
    .btn-auth:active,
    .auth-card .btn:active, .login-card .btn:active { transform: none !important; }
}
