@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;0,700;1,400&display=swap');

/* O fundo épico igual ao Menu Principal */
body {
    margin: 0;
    padding: 0;
    font-family: 'Cormorant Garamond', serif;
    background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.9)), url('/img/ui/login_background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    user-select: none;
}

/* O alinhamento das caixas */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* A caixa principal (O "Cartão" de Login) */
.auth-box {
    position: relative;
    background: rgba(20, 29, 38, 0.90);
    border: 2px solid #f1c40f;
    border-radius: 8px;
    padding: 40px;
    width: 350px;
    text-align: center;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.2);
}

/* O texto "WELCOME TO" ou "JOIN US ON" */
.auth-subtitle {
    font-family: 'Cinzel', serif;
    color: #bdc3c7;
    font-size: 18px;
    letter-spacing: 2px;
    margin: 0 0 15px 0;
}

/* A Imagem do Logótipo */
.auth-logo {
    width: 90%;
    max-width: 250px;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.8));
}

/* Estilo das Caixas de Texto (Inputs) */
input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #7f8c8d;
    background: #111;
    color: #ecf0f1;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
}

/* O Botão Principal de Submissão */
.auth-btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    color: #f1c40f;
    border: 2px solid #f1c40f;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-btn:hover {
    background: #f1c40f;
    color: black;
    box-shadow: 0 0 20px #f1c40f;
}

/* O Botão Verde (Sucesso ao Registar) */
.success-btn {
    border-color: #2ecc71;
    color: #2ecc71;
}

.success-btn:hover {
    background: #2ecc71;
    color: black;
    box-shadow: 0 0 20px #2ecc71;
}

/* Mensagens de Erro e Sucesso */
.erro {
    color: #e74c3c;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px black;
}

.sucesso {
    color: #2ecc71;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 20px;
}

/* O Rodapé (Link para a outra página) */
.auth-footer {
    margin-top: 30px;
    border-top: 1px solid #34495e;
    padding-top: 20px;
}

.auth-footer a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: white;
}

/* Password Verification */

#message {
    display: none;
    /* ---- MAGIA DO POSICIONAMENTO ---- */
    position: absolute;
    top: 50%;
    transform: translateY(-50%); /* Centra-o verticalmente a meio da caixa principal */
    left: calc(100% + 20px); /* Empurra-o para 20px à direita da caixa principal! */
    width: 320px; /* Largura fixa para manter o formato constante */
    z-index: 10;
    /* ---------------------------------- */

    background: rgba(10, 15, 20, 0.95);
    border: 1px solid #7f8c8d;
    border-radius: 4px;
    color: #bdc3c7;
    padding: 10px 15px;
    text-align: left;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    font-family: 'Cinzel', serif;
    opacity: 0;
}

/* Imagens (Bordas) */
.msg-border {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    user-select: none;
    opacity: 0.9;
}

/* Margens Negativas para "comer" o espaço transparente inútil das imagens */
.top-border {
    margin-bottom: -100px; /* Ajusta este valor (-60px, -40px) se achares que está muito perto ou longe */
}

.bottom-border {
    margin-top: -30px; /* Ajusta este valor para a borda de baixo */
}
/* O Segredo da Animação de Afastar: Usar Grid */
.msg-content-wrapper {
    display: grid;
    grid-template-rows: 0fr; /* Altura 0 */
    transition: grid-template-rows 0.6s ease-out, margin 0.6s ease-out; 
}
/* Texto lá dentro */
.msg-content {
    overflow: hidden;
    opacity: 0;
    /* Só começa a aparecer 0.4s depois, dando tempo às bordas de abrir! */
    transition: opacity 0.4s ease 0.4s; 
}
/* ========== ESTADOS DA ANIMAÇÃO ========== */
/* 1. Quando o jogador clica (ABRIR) */
.opening {
    animation: boxFadeIn 0.2s ease forwards; /* A caixa em si aparece */
}
.opening .msg-content-wrapper {
    grid-template-rows: 1fr; /* Força o conteúdo a crescer empurrando a borda para baixo */
    margin: 10px 0;
}
.opening .msg-content {
    opacity: 1; /* O texto aparece */
}
/* 2. Quando o jogador sai (FECHAR) */
.closing {
    animation: boxFadeOut 0.4s ease forwards;
}
.closing .msg-content-wrapper {
    grid-template-rows: 0fr;
    margin: 0;
    transition: grid-template-rows 0.4s ease, margin 0.4s ease;
}
.closing .msg-content {
    opacity: 0;
    transition: opacity 0.1s ease; /* Esconde logo o texto */
}
@keyframes boxFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes boxFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
/* Text styles inside message */
#message h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #f1c40f;
    border-bottom: 1px solid #34495e;
    padding-bottom: 5px;
}
#message p {
    padding: 2px 0 2px 25px;
    margin: 5px 0;
    font-size: 14px;
    position: relative;
    transition: color 0.3s;
}
/* Valid state (Verde) */
.valid { color: #2ecc71 !important; }
.valid:before { position: absolute; left: 5px; color: #2ecc71; font-weight: bold; }
/* Invalid state (Cinzento/Vermelho) */
.invalid { color: #7f8c8d !important; }
.invalid:before { position: absolute; left: 5px; color: #e74c3c; font-weight: bold; }