/* Importando uma fonte moderna */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Fundo escuro com um gradiente profundo */
    background: radial-gradient(circle at top right, #1a1a2e, #16213e, #0f3460);
    overflow: hidden;
}

/* Container principal com efeito de vidro */
.register-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.8s ease-out;
}

h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

/* Layout em Grid para Nome e Email */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Efeito de foco futurista */
input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00f2ff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}

/* Botão Estilizado */
button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #00f2ff, #0066ff);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.2s, box-shadow 0.3s;
    margin-top: 10px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 242, 255, 0.4);
}

button:active {
    transform: translateY(0);
}

/* Mensagem de Erro */
.error {
    background: rgba(255, 75, 75, 0.2);
    color: #ff4b4b;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ff4b4b;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* Responsividade */
@media (max-width: 480px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .register-container {
        margin: 20px;
        padding: 30px;
    }
}

/* Animação de entrada */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Media Query para Celulares e Tablets pequenos */
@media (max-width: 480px) {
    body {
        /* Permite rolagem se o teclado do celular cobrir os campos */
        overflow-y: auto;
        align-items: flex-start; /* Alinha ao topo para não sumir o campo de cima */
        padding: 20px 10px;
    }

    .register-container {
        margin: 0 auto;
        padding: 25px 20px;
        max-width: 100%;
        border-radius: 15px;
        backdrop-filter: blur(10px); /* Leve redução para melhor performance mobile */
    }

    h2 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }

    .grid-2 {
        grid-template-columns: 1fr; /* Força Nome e Email a ficarem um sobre o outro */
        gap: 0; /* O margin-bottom do input já dará o espaçamento */
    }

    input {
        padding: 14px;
        font-size: 16px; /* Essencial: evita o zoom automático do iPhone no foco */
        margin-bottom: 15px;
    }

    button {
        padding: 16px;
        font-size: 14px;
        margin-top: 5px;
    }

    /* Ajuste para que o fundo gradiente não "corte" ao rolar a página */
    body::after {
        content: "";
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: radial-gradient(circle at top right, #1a1a2e, #16213e, #0f3460);
        z-index: -1;
    }
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: black;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}