/* ===================================================
   SFI Login Page - Template 7 (Olympic Pool Theme)
   =================================================== */

:root {
    --primary: #1A2B6D;
    --primary-dark: #131F50;
    --primary-light: #2B4AAE;
    --accent: #1A2B6D;
    --accent-dark: #131F50;
    --shell: #1A2B6D;
    --shell-deep: #0E1A3D;
    --pool-deep: #131F50;
    --pool-mid: #1A2B6D;
    --pool-light: #2B4AAE;
    --card-bg: rgba(255,255,255,0.96);
    --text: #1E293B;
    --text-muted: #64748B;
    --border: #D6DBED;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}
h1,h2,h3,h4,h5,h6,.heading { font-family: 'Plus Jakarta Sans', sans-serif; }

/* ===== FULL-SCREEN POOL BACKGROUND ===== */
.pool-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg,
        #C9FAFE 0%,
        #A4F4F8 6%,
        #6FE8E8 14%,
        #3CD8E0 24%,
        #08B0DD 38%,
        #02BAD6 50%,
        #02BAD6 65%,
        #0DA8CC 78%,
        #0D9DC2 88%,
        #0D78AA 100%
    );
    z-index: 0;
}

/* Water caustics - light patterns on pool floor */
.caustics {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.35;
    background:
        radial-gradient(ellipse 100px 80px at 15% 20%, rgba(255,255,255,0.7), transparent),
        radial-gradient(ellipse 130px 90px at 45% 35%, rgba(255,255,255,0.5), transparent),
        radial-gradient(ellipse 90px 110px at 75% 15%, rgba(255,255,255,0.6), transparent),
        radial-gradient(ellipse 110px 80px at 25% 60%, rgba(255,255,255,0.4), transparent),
        radial-gradient(ellipse 140px 100px at 65% 55%, rgba(255,255,255,0.5), transparent),
        radial-gradient(ellipse 100px 90px at 85% 40%, rgba(255,255,255,0.4), transparent),
        radial-gradient(ellipse 80px 100px at 35% 80%, rgba(255,255,255,0.6), transparent),
        radial-gradient(ellipse 120px 80px at 55% 75%, rgba(255,255,255,0.4), transparent),
        radial-gradient(ellipse 90px 70px at 90% 70%, rgba(255,255,255,0.5), transparent);
    animation: causticShift 8s ease-in-out infinite alternate;
}
.caustics-2 {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.2;
    background:
        radial-gradient(ellipse 110px 90px at 30% 25%, rgba(255,255,255,0.6), transparent),
        radial-gradient(ellipse 90px 110px at 60% 45%, rgba(255,255,255,0.4), transparent),
        radial-gradient(ellipse 120px 80px at 80% 25%, rgba(255,255,255,0.5), transparent),
        radial-gradient(ellipse 100px 100px at 20% 50%, rgba(255,255,255,0.3), transparent),
        radial-gradient(ellipse 80px 90px at 50% 70%, rgba(255,255,255,0.5), transparent),
        radial-gradient(ellipse 110px 70px at 70% 80%, rgba(255,255,255,0.4), transparent);
    animation: causticShift2 10s ease-in-out infinite alternate;
}
@keyframes causticShift {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(15px, -10px) scale(1.02); }
    50% { transform: translate(-8px, 12px) scale(0.98); }
    75% { transform: translate(12px, 5px) scale(1.01); }
    100% { transform: translate(-5px, -8px) scale(1); }
}
@keyframes causticShift2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-12px, 8px) scale(1.03); }
    100% { transform: translate(8px, -12px) scale(0.97); }
}

/* Swimming lane lines */
.lane-lines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent calc(16.66% - 1px),
        rgba(255,255,255,0.12) calc(16.66% - 1px),
        rgba(255,255,255,0.12) calc(16.66% + 1px),
        transparent calc(16.66% + 1px)
    );
    pointer-events: none;
}

/* Lane rope - top decorative element */
.lane-rope {
    position: absolute;
    left: 0; right: 0;
    height: 12px;
    display: flex;
    align-items: center;
    z-index: 1;
    overflow: hidden;
}
.lane-rope-top { top: 28%; }
.lane-rope-bottom { top: 72%; }
.lane-rope-inner {
    display: flex;
    width: 200%;
    animation: ropeSlide 20s linear infinite;
}
.lane-rope-bottom .lane-rope-inner {
    animation-direction: reverse;
}
.rope-disc {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin: 0 3px;
}
.rope-disc.blue { background: rgba(26,43,109,0.6); }
.rope-disc.red { background: rgba(255,82,82,0.55); }
.rope-disc.white { background: rgba(255,255,255,0.7); }
.rope-disc.yellow { background: rgba(255,202,40,0.6); }
@keyframes ropeSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Bubbles */
.bubbles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    pointer-events: none;
}
.bubble {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), rgba(255,255,255,0.1));
    border: 1px solid rgba(255,255,255,0.35);
    animation: bubbleRise linear infinite;
}
.bubble:nth-child(1) { width: 8px; height: 8px; left: 10%; animation-duration: 12s; animation-delay: 0s; }
.bubble:nth-child(2) { width: 12px; height: 12px; left: 22%; animation-duration: 15s; animation-delay: 2s; }
.bubble:nth-child(3) { width: 6px; height: 6px; left: 35%; animation-duration: 10s; animation-delay: 4s; }
.bubble:nth-child(4) { width: 10px; height: 10px; left: 48%; animation-duration: 14s; animation-delay: 1s; }
.bubble:nth-child(5) { width: 7px; height: 7px; left: 62%; animation-duration: 11s; animation-delay: 3s; }
.bubble:nth-child(6) { width: 14px; height: 14px; left: 75%; animation-duration: 16s; animation-delay: 5s; }
.bubble:nth-child(7) { width: 9px; height: 9px; left: 88%; animation-duration: 13s; animation-delay: 2.5s; }
.bubble:nth-child(8) { width: 5px; height: 5px; left: 5%; animation-duration: 9s; animation-delay: 6s; }
.bubble:nth-child(9) { width: 11px; height: 11px; left: 55%; animation-duration: 17s; animation-delay: 1.5s; }
.bubble:nth-child(10) { width: 8px; height: 8px; left: 92%; animation-duration: 12s; animation-delay: 4.5s; }
@keyframes bubbleRise {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10% { opacity: 0.7; }
    50% { transform: translateY(-50vh) translateX(15px) scale(1.1); opacity: 0.5; }
    90% { opacity: 0.2; }
    100% { transform: translateY(-110vh) translateX(-10px) scale(0.8); opacity: 0; }
}

/* Water surface at top */
.water-surface {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100px;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.45) 0%,
        rgba(255,255,255,0.2) 30%,
        transparent 100%
    );
    z-index: 1;
}
.water-surface::after {
    content: '';
    position: absolute;
    bottom: 0; left: -10%; right: -10%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        rgba(255,255,255,0.35) 40px,
        transparent 80px
    );
    animation: surfaceWave 4s ease-in-out infinite;
}
@keyframes surfaceWave {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(30px); }
}

/* SVG Swimming Silhouettes */
.swimmer-silhouette {
    position: absolute;
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
}
.swimmer-1 {
    top: 18%; left: 5%;
    width: 120px;
    animation: swimAcross 25s linear infinite;
}
.swimmer-2 {
    top: 60%; right: 3%;
    width: 100px;
    animation: swimAcross 30s linear infinite reverse;
    transform: scaleX(-1);
}
.swimmer-silhouette svg { width: 100%; fill: white; }

@keyframes swimAcross {
    0% { transform: translateX(-30px); }
    50% { transform: translateX(30px); }
    100% { transform: translateX(-30px); }
}

/* ===== MAIN CONTENT AREA ===== */
.login-wrapper {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-container {
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 25px 80px rgba(26,43,109,0.3),
        0 8px 24px rgba(26,43,109,0.2),
        inset 0 0 0 1px rgba(255,255,255,0.25);
}

/* ===== LEFT: BRANDING PANEL (glass) ===== */
.brand-panel {
    background: rgba(26,43,109,0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.08);
}

/* Mini pool inside brand panel */
.brand-pool-effect {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.15;
    background:
        radial-gradient(ellipse 60px 40px at 30% 30%, rgba(59,90,180,0.5), transparent),
        radial-gradient(ellipse 50px 60px at 70% 60%, rgba(80,110,200,0.4), transparent),
        radial-gradient(ellipse 40px 50px at 50% 85%, rgba(45,70,160,0.3), transparent);
    animation: causticShift 6s ease-in-out infinite alternate;
}

.brand-content {
    position: relative;
    z-index: 2;
}

/* Animated pool icon */
.pool-icon-ring {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pool-icon-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #93B4F8;
    border-right-color: rgba(255,255,255,0.5);
    animation: ringRotate 4s linear infinite;
}
.pool-icon-ring::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-bottom-color: rgba(255,255,255,0.3);
    border-left-color: #7BA1F0;
    animation: ringRotate 3s linear infinite reverse;
}
@keyframes ringRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pool-icon-inner {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59,90,180,0.3), rgba(100,130,220,0.15));
    border: 1px solid rgba(80,110,200,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #93B4F8;
    position: relative;
    z-index: 1;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: rgba(255,255,255,0.7);
    letter-spacing: 2.5px;
    margin-bottom: 0.2rem;
    line-height: 1.45;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.brand-title .hi { color: #FFFFFF; text-shadow: 0 0 12px rgba(255,255,255,0.5), 0 0 24px rgba(255,255,255,0.2); }
.brand-subtitle {
    font-size: 0.8rem;
    color: #FFFFFF;
    letter-spacing: 1.5px;
    margin-top: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(255,255,255,0.3), 0 0 60px rgba(200,220,255,0.2);
    animation: subtitleGlow 3s ease-in-out infinite alternate;
}
@keyframes subtitleGlow {
    0% { text-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(255,255,255,0.3); }
    100% { text-shadow: 0 0 12px rgba(255,255,255,1), 0 0 28px rgba(255,255,255,0.6), 0 0 50px rgba(255,255,255,0.4), 0 0 70px rgba(200,220,255,0.25); }
}

/* Wave divider */
.wave-divider {
    width: 100%;
    max-width: 200px;
    height: 20px;
    margin: 0 auto 1.25rem;
    position: relative;
}
.wave-divider svg { width: 100%; height: 100%; }
.wave-divider path {
    fill: none;
    stroke: rgba(120,150,220,0.5);
    stroke-width: 2;
    stroke-linecap: round;
}

/* New to SFI */
.register-block h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.register-block p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 1rem;
}

.reg-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
}
.reg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    color: #1A2B6D;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.5px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F0F5 100%);
    border: 1px solid rgba(255,255,255,0.95);
    border-bottom: 3px solid rgba(0,0,0,0.12);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.08);
    cursor: pointer;
}
.reg-btn:hover {
    transform: translateY(-2px);
    color: #1A2B6D;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15), 0 8px 24px rgba(0,0,0,0.12);
    background: linear-gradient(180deg, #FFFFFF 0%, #E8E8F0 100%);
}
.reg-btn:active {
    transform: translateY(1px);
    border-bottom: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.reg-btn i { font-size: 1rem; }

/* ===== RIGHT: LOGIN FORM (white glass) ===== */
.form-panel {
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-logo {
    max-width: 280px;
    margin-bottom: 0.6rem;
}
.login-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #64748B;
    margin: 0.5rem 0 0;
}
.login-header .accent-line {
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    margin: 8px auto 0;
}

/* Form fields */
.form-field {
    position: relative;
    margin-bottom: 14px;
}
.form-field .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 14px;
    z-index: 2;
    transition: color 0.2s;
}
.form-field input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    font-size: 0.93rem;
    font-family: 'Inter', sans-serif;
    background: #FFFFFF;
    color: var(--text);
    transition: all 0.25s;
}
.form-field input:focus {
    border-color: #93A3D1;
    box-shadow: 0 0 0 2px rgba(26,43,109,0.08);
    background: #fff;
    outline: none;
}
.form-field input:focus + .field-icon,
.form-field input:focus ~ .field-icon { color: var(--primary-dark); }
.form-field input::placeholder { color: #94A3B8; }
.toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 4px;
    color: #94A3B8; font-size: 14px; z-index: 2; transition: color 0.2s;
}
.toggle-password:hover { color: var(--primary); }

/* Captcha */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.captcha-display {
    padding: 8px 14px;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--shell);
    user-select: none;
    min-width: 90px;
    text-align: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.captcha-refresh {
    background: none;
    border: 1.5px solid #CBD5E1;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.captcha-refresh:hover { background: #EBEEF8; border-color: var(--primary); }
.captcha-input { flex: 1; }
.captcha-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    background: #FFFFFF;
    color: var(--text);
}
.captcha-input input:focus {
    outline: none;
    border-color: #93A3D1;
    box-shadow: 0 0 0 2px rgba(26,43,109,0.08);
    background: #fff;
}

/* Error messages */
.error-message {
    display: block;
    color: #DC2626;
    font-size: 0.82rem;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Links */
.links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-bottom: 14px;
}
.links-row a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 2px 0;
    position: relative;
}
.links-row a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.2s;
}
.links-row a:hover::after { transform: scaleX(1); }
.links-row a:hover { color: var(--primary-dark); }
.support-text {
    color: #DC2626;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.support-text i { font-size: 12px; }

/* Sign in */
.btn-signin {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: #fff;
    background: #1A2B6D;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.btn-signin:hover {
    background: #2B4AAE;
    box-shadow: 0 6px 24px rgba(26,43,109,0.45);
    transform: translateY(-1px);
}
.btn-signin i { margin-right: 6px; }

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.login-footer p {
    color: #94A3B8;
    font-size: 0.75rem;
    margin: 0;
}
.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Session alert messages */
.alert-notify {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-notify.success {
    background: rgba(22,163,74,0.1);
    border: 1px solid rgba(22,163,74,0.3);
    color: #15803D;
}
.alert-notify.error {
    background: rgba(220,38,38,0.1);
    border: 1px solid rgba(220,38,38,0.3);
    color: #DC2626;
}
.alert-notify i { flex-shrink: 0; }

/* Back to login link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 14px;
    transition: color 0.2s;
}
.back-link:hover { color: var(--primary-dark); }
.back-link i { font-size: 0.75rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 850px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 460px;
    }
    .brand-panel {
        padding: 2rem 1.5rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .reg-buttons {
        flex-direction: row;
        max-width: 100%;
        justify-content: center;
    }
    .pool-icon-ring { width: 80px; height: 80px; margin-bottom: 1rem; }
    .pool-icon-inner { width: 60px; height: 60px; font-size: 26px; }
    .brand-title { font-size: 1rem; }
}

@media (max-width: 520px) {
    .login-wrapper { padding: 1rem; }
    .brand-panel { padding: 1.5rem 1.25rem 1.25rem; }
    .form-panel { padding: 1.5rem 1.25rem; }
    .reg-buttons { flex-direction: column; max-width: 220px; }
    .login-logo { max-width: 160px; }
    .links-row { flex-direction: column; gap: 4px; }
    .captcha-row { flex-wrap: wrap; }
}
