/* ============================================================
   Project LIGHTHOUSE — Login & Auth Stylesheet
   Sibuguey Valley Masonic Lodge No. 246
   Color palette: Gold (#f0b000) + Blue (#0d6090) from logo
   ============================================================ */

/* ---------- Full-page Background ---------- */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #041520 0%, #063a58 35%, #0d6090 65%, #041520 100%);
    position: relative;
    overflow: hidden;
    padding: 20px 20px 70px;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Subtle overlay with gold accent */
.login-page::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(240,176,0,0.04) 0%, transparent 40%),
        radial-gradient(circle at 75% 25%, rgba(0,176,240,0.03) 0%, transparent 35%),
        radial-gradient(circle at 50% 60%, rgba(255,255,255,0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* Gold accent line */
.login-page::after {
    content: '';
    position: absolute;
    bottom: 12%;
    left: -10%;
    width: 120%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(240,176,0,0.12) 30%, rgba(240,176,0,0.25) 50%, rgba(240,176,0,0.12) 70%, transparent 100%);
    animation: lineGlow 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lineGlow {
    0%   { transform: translateX(-5%) scaleY(1); opacity: 0.6; }
    50%  { transform: translateX(3%) scaleY(1.5); opacity: 1; }
    100% { transform: translateX(-5%) scaleY(1); opacity: 0.6; }
}

/* Decorative floating elements */
.login-bg-icon {
    position: absolute;
    pointer-events: none;
    color: rgba(240, 176, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-bg-icon svg { width: 100%; height: 100%; }

.login-bg-icon:nth-child(1) {
    width: 220px; height: 220px;
    top: -50px; left: -50px;
    animation: floatSlow 12s ease-in-out infinite;
}
.login-bg-icon:nth-child(2) {
    width: 160px; height: 160px;
    bottom: -30px; right: -30px;
    animation: floatSlow 15s ease-in-out infinite 3s;
}
.login-bg-icon:nth-child(3) {
    width: 120px; height: 120px;
    top: 38%; right: 8%;
    animation: floatSlow 10s ease-in-out infinite 1.5s;
    opacity: .5;
}
.login-bg-icon:nth-child(4) {
    width: 90px; height: 90px;
    bottom: 25%; left: 10%;
    animation: floatSlow 13s ease-in-out infinite 4s;
    opacity: .4;
}

@keyframes floatSlow {
    0%   { transform: translateY(0) rotate(0deg) scale(1); }
    25%  { transform: translateY(-10px) rotate(3deg) scale(1.02); }
    50%  { transform: translateY(-4px) rotate(-2deg) scale(0.98); }
    75%  { transform: translateY(6px) rotate(1deg) scale(1.01); }
    100% { transform: translateY(0) rotate(0deg) scale(1); }
}

/* Firefly / particle dots — gold tinted */
.firefly {
    position: absolute;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: rgba(240, 176, 0, 0.4);
    box-shadow: 0 0 6px 2px rgba(240, 176, 0, 0.15);
    pointer-events: none;
    animation: fireflyFloat 8s ease-in-out infinite;
}
.firefly:nth-child(5) { top: 20%; left: 15%; animation-delay: 0s; animation-duration: 9s; }
.firefly:nth-child(6) { top: 45%; right: 20%; animation-delay: 2s; animation-duration: 11s; }
.firefly:nth-child(7) { top: 70%; left: 30%; animation-delay: 4s; animation-duration: 7s; }
.firefly:nth-child(8) { top: 30%; right: 35%; animation-delay: 1s; animation-duration: 10s; }
.firefly:nth-child(9) { top: 60%; left: 60%; animation-delay: 3s; animation-duration: 12s; }
.firefly:nth-child(10) { top: 15%; left: 70%; animation-delay: 5s; animation-duration: 8s; }
.firefly:nth-child(11) { top: 80%; right: 15%; animation-delay: 2.5s; animation-duration: 9.5s; }
.firefly:nth-child(12) { top: 50%; left: 8%; animation-delay: 6s; animation-duration: 13s; }

@keyframes fireflyFloat {
    0%   { opacity: 0; transform: translate(0, 0); }
    15%  { opacity: 1; }
    50%  { opacity: 0.6; transform: translate(30px, -20px); }
    85%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-10px, 15px); }
}

/* ---------- Login Card ---------- */
.login-card {
    background: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    padding: 40px 36px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: cardFadeIn 0.6s ease;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Logo Container ---------- */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo-img {
    width: 80px !important; height: 80px !important;
    max-width: 80px !important; max-height: 80px !important;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(240, 176, 0, 0.2);
    margin: 0 auto 18px;
    display: block;
    border: 3px solid rgba(240, 176, 0, 0.3);
}

.logo-placeholder {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6090, #1a80b8);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 8px 24px rgba(13, 96, 144, 0.3);
    border: 3px solid rgba(240, 176, 0, 0.3);
}

.logo-placeholder i { font-size: 2rem; color: #f0b000; }
.logo-placeholder img { width: 48px; height: 48px; object-fit: contain; }

.login-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 6px;
}

.login-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.login-division {
    font-size: 0.72rem;
    font-weight: 600;
    color: #0d6090;
    margin: 8px 0 0;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.5;
}

/* ---------- Login Form ---------- */
.login-form { margin-top: 28px; }
.login-form .form-group { margin-bottom: 18px; }

.login-form .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
    display: block;
}

.login-form .input-group-icon { position: relative; }

.login-form .input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.95rem;
    z-index: 2;
    pointer-events: none;
    transition: color 0.2s;
}

.login-form .form-control {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px; /* Prevents iOS zoom */
    color: #374151;
    background: #f9fafb;
    transition: all 0.25s ease;
    outline: none;
}

.login-form .form-control:focus {
    border-color: #0d6090;
    box-shadow: 0 0 0 3px rgba(13, 96, 144, 0.12);
    background: #fff;
}

.login-form .form-control:focus + .input-icon,
.login-form .form-control:focus ~ .input-icon {
    color: #0d6090;
}

.login-form .form-control::placeholder { color: #9ca3af; }

/* Password toggle */
.login-form .password-toggle {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    z-index: 2;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.login-form .password-toggle:hover { color: #6b7280; }

/* Remember me / Forgot */
.login-form .form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 8px;
}

.login-form .form-check { display: flex; align-items: center; gap: 6px; }
.login-form .form-check-input {
    width: 16px; height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    accent-color: #0d6090;
}
.login-form .form-check-label { font-size: 0.8rem; color: #6b7280; cursor: pointer; }

.login-form .forgot-link {
    font-size: 0.8rem;
    color: #0d6090;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.login-form .forgot-link:hover { color: #094d73; text-decoration: underline; }

/* Invalid feedback */
.login-form .invalid-feedback { font-size: 0.75rem; color: #ef4444; margin-top: 5px; display: none; }
.login-form .form-control.is-invalid { border-color: #ef4444; }
.login-form .form-control.is-invalid ~ .invalid-feedback { display: block; }

/* Alert */
.login-form .login-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.login-form .login-alert-danger { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.login-form .login-alert-success { background: rgba(16, 185, 129, 0.1); color: #059669; }

/* ---------- Login Button ---------- */
.btn-login {
    width: 100%;
    padding: 0;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d6090 0%, #1a80b8 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    -webkit-tap-highlight-color: transparent;
}

.btn-login:hover {
    background: linear-gradient(135deg, #094d73 0%, #0d6090 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(13, 96, 144, 0.35);
    color: #fff;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(13, 96, 144, 0.25);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-login .spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
.btn-login.loading .spinner { display: block; }
.btn-login.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login Footer ---------- */
.login-footer {
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    z-index: 1;
}

.login-footer-logo {
    width: 28px !important; height: 28px !important;
    max-width: 28px !important; max-height: 28px !important;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    padding: 2px;
    margin-bottom: 2px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.login-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.6;
}

.login-footer a {
    color: rgba(240, 176, 0, 0.9);
    text-decoration: none;
    font-weight: 500;
}
.login-footer a:hover { text-decoration: underline; color: #f0b000; }

/* ---------- Card Separator ---------- */
.login-separator {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: #9ca3af;
    font-size: 0.78rem;
}

.login-separator::before,
.login-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
    .login-card {
        padding: 28px 22px;
        margin: 10px;
        border-radius: 14px;
    }
    .logo-placeholder { width: 68px; height: 68px; }
    .logo-placeholder i { font-size: 1.6rem; }
    .login-logo-img {
        width: 68px !important; height: 68px !important;
        max-width: 68px !important; max-height: 68px !important;
    }
    .login-title { font-size: 1.15rem; }
    .login-subtitle { font-size: 0.8rem; }
    .login-division { font-size: 0.68rem; }
    .btn-login { height: 46px; font-size: 0.88rem; }
    .logo-container { margin-bottom: 22px; }
    .login-form { margin-top: 22px; }

    .login-bg-icon:nth-child(1) { width: 140px; height: 140px; }
    .login-bg-icon:nth-child(2) { width: 100px; height: 100px; }
    .login-bg-icon:nth-child(3),
    .login-bg-icon:nth-child(4),
    .login-bg-icon:nth-child(5),
    .login-bg-icon:nth-child(6),
    .login-bg-icon:nth-child(7) {
        display: none;
    }

    .login-footer {
        position: relative;
        margin-top: 20px;
        padding: 12px 16px;
    }
}

@media (max-width: 399.98px) {
    .login-card {
        padding: 22px 16px;
        margin: 6px;
    }
    .login-form .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .login-form .form-control {
        padding: 11px 14px 11px 38px;
    }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
    .login-page {
        background: linear-gradient(135deg, #020d14 0%, #041520 50%, #063a58 100%);
    }
}
