/* Importación de fuentes */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap');

/* Variables CSS para colores */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2d2d2d;
    --accent-color: #4a4a4a;
    --text-white: #ffffff;
    --text-gray: #e0e0e0;
    --hover-color: #3a3a3a;
}

/* BODY y fondo animado */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 50px 20px;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0,0,0,0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none; z-index: 1;
}

body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none; z-index: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

/* Contenedor principal fluido */
.container {
    width: 90%;
    max-width: 700px;
    padding: 2.5rem;
    box-sizing: border-box;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(30px);
    border-radius: 2rem;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.2),
        0 0 0 1px rgba(255,255,255,0.3),
        inset 0 1px 0 rgba(255,255,255,0.4);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.2);
    margin: 0 auto;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}

.container:hover {
    transform: translateY(-0.625rem) scale(1.02);
    box-shadow: 
        0 2.1875rem 4.375rem rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.4),
        inset 0 1px 0 rgba(255,255,255,0.5);
}

.container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 0.375rem;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe);
    border-radius: 2rem 2rem 0 0;
    animation: gradientShift 3s ease infinite;
}

.container::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: rotate 10s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Logo */
.logo-container { text-align: center; margin-bottom: 1.875rem; }
.logo { width: 7.5rem; border-radius: 1.25rem; transition: all 0.4s; }
.logo:hover { transform: scale(1.1) rotate(5deg); }

/* Formularios login/registro */
.form-section {
    display: none;
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 0.3125rem;
}

.form-section.active { display: block; animation: fadeInUp 0.6s ease-out; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(1.875rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* Inputs responsivos */
input[type="text"], input[type="password"] {
    width: 100%;
    padding: 0.9em 1em;
    margin-bottom: 1em;
    border-radius: 1.2em;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(20px);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255,255,255,0.3);
}

/* Botones responsivos */
button {
    width: 100%;
    padding: 0.9em 1em;
    border-radius: 1.2em;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover { transform: scale(1.05); }

/* Títulos */
h2 {
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5625rem;
}

/* Enlaces registro */
#registerLink { text-align: center; margin-top: 1.25rem; }
#registerLink button { width: auto; padding: 0.625em 1.5625em; font-size: 0.875rem; }

/* Media Queries para pantallas grandes */
@media (min-width: 1200px) {
    .container { width: 60%; padding: 3.125rem; }
}

/* Media Queries para pantallas medianas */
@media (max-width: 768px) {
    .container { width: 95%; padding: 1.5625rem; }
    input[type="text"], input[type="password"] { padding: 0.8em 0.9em; font-size: 0.9rem; }
    button { padding: 0.8em 0.9em; font-size: 0.9rem; }
    h2 { font-size: 1.75rem; }
}

/* Media Queries para pantallas pequeñas */
@media (max-width: 480px) {
    .container { width: 95%; padding: 1.25rem; margin: 0.625rem; }
    input[type="text"], input[type="password"] { padding: 0.6em 0.7em; font-size: 0.85rem; margin-bottom: 0.8em; }
    button { font-size: 0.85rem; padding: 0.6em 0.7em; }
    h2 { font-size: 1.5rem; }
    #registerLink button { padding: 0.5em 1em; font-size: 0.8rem; }
}

.input-password-container {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.input-password-container input {
    width: 100%;
    padding-right: 3rem; /* espacio para el botón */
    border-radius: 1.2em;
    padding: 0.9em 1em;
    font-size: 1rem;
    box-sizing: border-box;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 0.8rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
    padding: 0;
}

.toggle-password:hover {
    color: #667eea;
}
