/* Fountain House — Login (modern) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800&display=swap');

html.login-html,
html.login-html body.login-page {
    height: 100%;
    max-height: 100%;
    margin: 0;
    overflow: hidden;
}

body.login-page {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    max-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
    position: relative;
    background: #0b1220;
    -webkit-font-smoothing: antialiased;
}

/* Animated mesh background */
body.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        125deg,
        #0f172a 0%,
        #1e1b4b 22%,
        #312e81 40%,
        #1e3a8a 58%,
        #0c4a6e 72%,
        #134e4a 88%,
        #0f172a 100%
    );
    background-size: 320% 320%;
    animation: loginMesh 18s ease infinite;
}

body.login-page::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 55% at 8% 12%, rgba(99, 102, 241, 0.35), transparent 55%),
        radial-gradient(ellipse 55% 45% at 92% 18%, rgba(14, 165, 233, 0.28), transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 95%, rgba(16, 185, 129, 0.22), transparent 48%);
    animation: loginGlow 14s ease-in-out infinite alternate;
}

@keyframes loginMesh {
    0%, 100% { background-position: 0% 40%; }
    50% { background-position: 100% 60%; }
}

@keyframes loginGlow {
    0% { opacity: 0.75; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.04); }
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 2rem);
}

.login-panel {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 1.35rem;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.04),
        0 24px 48px -12px rgba(15, 23, 42, 0.35),
        0 8px 24px -8px rgba(79, 70, 229, 0.15);
    padding: 1.5rem 1.5rem 1.35rem;
    animation: loginPanelIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes loginPanelIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 1.15rem;
}

.login-logo-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem;
    padding: 0.5rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, #eef2ff, #f8fafc);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-wrap img {
    width: 100%;
    height: auto;
    max-height: 48px;
    object-fit: contain;
    border-radius: 0.35rem;
}

.login-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6366f1;
}

.login-app-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.login-app-title span {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 0.15rem;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.65rem;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.85rem;
    text-align: left;
}

.login-alert i {
    flex-shrink: 0;
    margin-top: 1px;
}

.login-form {
    text-align: left;
}

.login-field {
    margin-bottom: 0.65rem;
}

.login-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap > i {
    position: absolute;
    left: 0.75rem;
    font-size: 0.95rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-input-wrap .form-control {
    width: 100%;
    font-size: 0.84rem;
    font-weight: 500;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    padding: 0.55rem 0.75rem 0.55rem 2.35rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input-wrap .form-control::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.login-input-wrap .form-control:hover {
    border-color: #cbd5e1;
}

.login-input-wrap .form-control:focus {
    background: #fff;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
    outline: none;
}

.login-input-wrap:focus-within > i {
    color: #6366f1;
}

.btn-login {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.62rem 1rem;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    border: none;
    border-radius: 0.7rem;
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 50%, #0ea5e9 100%);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-login:hover {
    color: #fff;
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

@media (max-width: 380px) {
    .login-panel {
        padding: 1.25rem 1.15rem 1.1rem;
    }

    .login-app-title {
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.login-page::before,
    body.login-page::after,
    .login-panel {
        animation: none;
    }
}
