/**
 * Layout e animações da página de Login
 * Moderno, intuitivo e animado
 */

.login-page {
    min-height: 100vh;
    display: flex;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* --- Painel esquerdo (branding) --- */
.login-page__brand {
    flex: 1;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    position: relative;
    overflow: hidden;
}

.login-page__brand::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    animation: login-bg-pulse 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes login-bg-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.login-page__brand-content {
    position: relative;
    z-index: 1;
    animation: login-fade-in-up 0.8s ease-out;
}

@keyframes login-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-page__brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.35);
    animation: login-icon-float 4s ease-in-out infinite;
}

@keyframes login-icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.login-page__brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.login-page__brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    max-width: 320px;
    line-height: 1.6;
}

/* Formas decorativas animadas */
.login-page__shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-page__shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

.login-page__shape--1 {
    width: 300px;
    height: 300px;
    background: rgba(59, 130, 246, 0.3);
    top: 10%;
    right: 10%;
    animation: login-shape-drift 15s ease-in-out infinite;
}

.login-page__shape--2 {
    width: 200px;
    height: 200px;
    background: rgba(16, 185, 129, 0.25);
    bottom: 20%;
    left: 5%;
    animation: login-shape-drift 18s ease-in-out infinite reverse;
    animation-delay: -3s;
}

.login-page__shape--3 {
    width: 150px;
    height: 150px;
    background: rgba(139, 92, 246, 0.2);
    top: 50%;
    left: 30%;
    animation: login-shape-drift 12s ease-in-out infinite;
    animation-delay: -5s;
}

@keyframes login-shape-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -15px) scale(1.05); }
    66% { transform: translate(-10px, 10px) scale(0.95); }
}

/* --- Painel direito (formulário) --- */
.login-page__form-wrap {
    flex: 0 0 480px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f8fafc;
    animation: login-fade-in 0.6s ease-out 0.2s both;
}

@keyframes login-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-page__form-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
    padding: 2.5rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    animation: login-fade-in-up 0.6s ease-out 0.3s both;
}

.login-page__form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-page__form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.login-page__form-header p {
    color: #64748b;
    font-size: 0.9375rem;
}

/* Campos com ícones */
.login-page__input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.login-page__input-group .form-control {
    padding-left: 2.75rem;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-page__input-group .form-control:hover {
    border-color: #cbd5e1;
}

.login-page__input-group .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

.login-page__input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.125rem;
    pointer-events: none;
    transition: color 0.2s;
}

.login-page__input-group:focus-within .login-page__input-icon {
    color: #3b82f6;
}

.login-page__input-group .form-label {
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.35rem;
    font-size: 0.9375rem;
}

/* Botão de login */
.login-page__submit {
    width: 100%;
    height: 48px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    margin-top: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.login-page__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
    color: #fff;
}

.login-page__submit:active {
    transform: translateY(0);
}

/* Links secundários */
.login-page__links {
    text-align: center;
    margin-top: 1.5rem;
}

.login-page__links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.login-page__links a:hover {
    color: #3b82f6;
}

.login-page__links .login-page__link-register {
    font-weight: 600;
    color: #334155;
}

.login-page__links .login-page__link-register:hover {
    color: #3b82f6;
}

.login-page__divider {
    margin: 1rem 0;
    color: #cbd5e1;
    font-size: 0.8125rem;
}

/* Alertas com animação */
.login-page__alert {
    border-radius: 12px;
    border: none;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    animation: login-shake 0.5s ease-out;
}

@keyframes login-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* --- Responsivo: empilhar em ecrãs pequenos --- */
@media (max-width: 991px) {
    .login-page {
        flex-direction: column;
    }

    .login-page__brand {
        min-height: auto;
        padding: 2.5rem 2rem;
        text-align: center;
    }

    .login-page__brand p {
        max-width: none;
        margin: 0 auto;
    }

    .login-page__brand-icon {
        margin-left: auto;
        margin-right: auto;
    }

    .login-page__form-wrap {
        flex: 1;
        min-height: auto;
        padding: 2rem 1.5rem;
    }

    .login-page__form-card {
        padding: 2rem;
    }
}

@media (max-width: 575px) {
    .login-page__brand h1 {
        font-size: 1.5rem;
    }

    .login-page__form-card {
        padding: 1.5rem;
    }
}
