/* ================================================================
   auth.css — Estilos partilhados de todas as páginas de autenticação
   login.php | recuperacao.php | alterar_password.php
   primeira_password.php | verificar_2fa.php
   ================================================================ */

:root {
    --red: #E8192C;
    --red-dark: #B8111F;
    --dark: #1a1a2e;
    --dark2: #16213e;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --muted: #6b7280;
    --border: #e5e7eb;
    --input-bg: #f9fafb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated background blobs */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(232, 25, 44, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: blob 8s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(15, 52, 96, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: blob 10s ease-in-out infinite reverse;
}

@keyframes blob {

    0%,
    100% {
        transform: scale(1) translate(0, 0);
    }

    33% {
        transform: scale(1.1) translate(20px, -20px);
    }

    66% {
        transform: scale(0.9) translate(-20px, 20px);
    }
}

/* Wrapper & card */
.login-wrapper,
.wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card,
.card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 48px 44px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Logo */
.login-logo,
.logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img,
.logo img {
    max-height: 56px;
    width: auto;
}

/* Títulos */
.login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 28px;
}

/* Labels */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

/* Input group */
.input-group-login {
    position: relative;
    margin-bottom: 18px;
}

.input-icon {
    position: absolute;
    left: 14px;
    bottom: 14px;
    color: var(--muted);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s;
}

.form-input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    transition: all 0.25s;
    outline: none;
}

.form-input:focus {
    border-color: var(--red);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(232, 25, 44, 0.12);
}

.form-input:focus+.input-icon,
.input-group-login:focus-within .input-icon {
    color: var(--red);
}

/* Password toggle */
.pass-toggle {
    position: absolute;
    right: 14px;
    bottom: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    padding: 0;
    transition: color 0.2s;
}

.pass-toggle:hover {
    color: var(--red);
}

/* Botão principal */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.03em;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(232, 25, 44, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* Links e divisores */
.forgot-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--red);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.security-badge svg {
    width: 14px;
    height: 14px;
}

/* ── Específico: alterar_password — barra de força ── */
.strength-bar-wrap {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}

.strength-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

/* ── Específico: verificar_2fa — botão reenviar ── */
.btn-resend {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-resend:hover:not(:disabled) {
    border-color: var(--red);
    color: var(--red);
    background: #fff5f5;
}

.btn-resend:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Alert de erro */
.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}