@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap");

/* ========================================
   VARIABLES CSS Y CONFIGURACIÓN BASE
======================================== */
:root {
    --primary-blue: #3b82f6;
    --primary-blue-dark: #1e40af;
    --primary-blue-light: #60a5fa;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --white: #ffffff;
    --red-500: #ef4444;
    --red-400: #f87171;
    --green-500: #059669;
    --green-400: #10b981;
    --gold-gradient: linear-gradient(45deg, #ffd700, #ffa500, #ffffff);

    /* Espaciados responsivos */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    --spacing-3xl: 3rem;

    /* Tamaños de fuente responsivos */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Breakpoints */
    --mobile-sm: 320px;
    --mobile-md: 375px;
    --mobile-lg: 425px;
    --tablet-sm: 768px;
    --tablet-lg: 1024px;
    --desktop-sm: 1280px;
    --desktop-md: 1440px;
    --desktop-lg: 1920px;
}

/* ========================================
   ESTILOS BASE
======================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(
        135deg,
        var(--slate-900) 0%,
        var(--slate-800) 50%,
        var(--slate-700) 100%
    );
    min-height: 100vh;
    overflow-x: hidden;
    font-size: var(--text-base);
    line-height: 1.6;
}

/* ========================================
   CONTENEDOR PRINCIPAL
======================================== */
.email-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    opacity: 0;
    animation: fadeInContainer 0.8s ease-out 0.1s forwards;
}

@keyframes fadeInContainer {
    to {
        opacity: 1;
    }
}

/* ========================================
   SECCIÓN IZQUIERDA
======================================== */
.left-section {
    flex: 1;
    background: linear-gradient(
        135deg,
        var(--primary-blue-dark) 0%,
        var(--primary-blue) 50%,
        var(--primary-blue-light) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transform: translateX(-20px);
    opacity: 0;
    animation: slideInLeft 0.6s ease-out 0.2s forwards;
    padding: var(--spacing-xl);
}

@keyframes slideInLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        var(--primary-blue-dark) 0%,
        var(--primary-blue) 50%,
        var(--primary-blue-light) 100%
    );
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: fadeInShapes 0.8s ease-out 0.6s forwards;
}

@keyframes fadeInShapes {
    to {
        opacity: 1;
    }
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.shape:nth-child(1) {
    width: clamp(60px, 8vw, 100px);
    height: clamp(60px, 8vw, 100px);
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1),
        rgba(59, 130, 246, 0.2)
    );
}

.shape:nth-child(2) {
    width: clamp(80px, 12vw, 140px);
    height: clamp(80px, 12vw, 140px);
    top: 55%;
    left: 65%;
    animation-delay: 2s;
    background: linear-gradient(
        45deg,
        rgba(96, 165, 250, 0.2),
        rgba(255, 255, 255, 0.1)
    );
}

.shape:nth-child(3) {
    width: clamp(50px, 6vw, 80px);
    height: clamp(50px, 6vw, 80px);
    top: 75%;
    left: 20%;
    animation-delay: 4s;
    background: linear-gradient(
        45deg,
        rgba(30, 64, 175, 0.3),
        rgba(255, 255, 255, 0.1)
    );
}

.shape:nth-child(4) {
    width: clamp(40px, 5vw, 60px);
    height: clamp(40px, 5vw, 60px);
    top: 25%;
    left: 80%;
    animation-delay: 1s;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15),
        rgba(59, 130, 246, 0.2)
    );
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.7;
    }
    33% {
        transform: translateY(-40px) rotate(120deg) scale(1.1);
        opacity: 1;
    }
    66% {
        transform: translateY(-20px) rotate(240deg) scale(0.9);
        opacity: 0.8;
    }
}

.content-wrapper {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--white);
    width: 100%;
    max-width: clamp(300px, 90%, 520px);
    transform: translateY(15px);
    opacity: 0;
    animation: slideUpContent 0.6s ease-out 0.4s forwards;
}

@keyframes slideUpContent {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.logo {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 900;
    margin-bottom: var(--spacing-lg);
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
    }
    100% {
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.7));
    }
}

.tagline {
    font-size: clamp(1.25rem, 4vw, 1.8rem);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    color: var(--white);
}

.subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    opacity: 0.95;
    line-height: 1.6;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: var(--spacing-lg);
    color: var(--white);
}

.home-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 25px;
    text-decoration: none;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xl);
}

.home-button:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    opacity: 0;
    animation: fadeInFeatures 0.6s ease-out 0.8s forwards;
}

@keyframes fadeInFeatures {
    to {
        opacity: 1;
    }
}

.feature-item {
    display: flex;
    align-items: center;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    opacity: 0.9;
    color: var(--white);
}

.feature-icon {
    width: clamp(32px, 6vw, 40px);
    height: clamp(32px, 6vw, 40px);
    margin-right: var(--spacing-md);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.feature-icon svg {
    width: clamp(16px, 3vw, 20px);
    height: clamp(16px, 3vw, 20px);
    fill: var(--white);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ========================================
   SECCIÓN DERECHA
======================================== */
.right-section {
    flex: 1;
    background: linear-gradient(
        135deg,
        var(--slate-900) 0%,
        var(--slate-800) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    position: relative;
    transform: translateX(20px);
    opacity: 0;
    animation: slideInRight 0.6s ease-out 0.3s forwards;
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.email-form-wrapper {
    width: 100%;
    max-width: clamp(300px, 90%, 450px);
    position: relative;
    z-index: 2;
    transform: translateY(15px);
    opacity: 0;
    animation: slideUpForm 0.6s ease-out 0.5s forwards;
}

@keyframes slideUpForm {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.form-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.form-header::before {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--primary-blue),
        var(--primary-blue-dark)
    );
    border-radius: 2px;
}

.form-title {
    font-size: clamp(1.75rem, 5vw, 2.2rem);
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    color: var(--white);
    line-height: 1.2;
    position: relative;
    letter-spacing: -0.02em;
}

.form-title::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 1px;
}

.form-subtitle {
    color: var(--slate-400);
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    font-weight: 400;
    margin-top: var(--spacing-sm);
    font-style: italic;
}

.success-alert {
    background: linear-gradient(
        135deg,
        var(--green-500) 0%,
        var(--green-400) 100%
    );
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: clamp(0.8rem, 2vw, 1rem);
    margin-bottom: var(--spacing-lg);
    color: var(--white);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: clamp(0.6rem, 2vw, 0.8rem);
    backdrop-filter: blur(10px);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.success-icon {
    width: clamp(16px, 3vw, 20px);
    height: clamp(16px, 3vw, 20px);
    flex-shrink: 0;
}

/* ========================================
   FORMULARIO
======================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
    transform: translateY(10px);
    opacity: 0;
    animation: slideUpInput 0.4s ease-out 0.7s forwards;
}

@keyframes slideUpInput {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.form-label {
    display: block;
    color: var(--slate-200);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: clamp(0.75rem, 2vw, 0.9rem) var(--spacing-md);
    background: rgba(30, 41, 59, 0.5);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: var(--white);
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    font-weight: 400;
    transition: all 0.3s ease;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}

.form-input::placeholder {
    color: var(--slate-500);
    font-weight: 300;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(30, 41, 59, 0.7);
    transform: translateY(-1px);
}

.form-input.is-invalid {
    border-color: var(--red-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.invalid-feedback {
    color: var(--red-400);
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
    margin-top: 0.4rem;
    font-weight: 500;
}

/* ========================================
   BOTONES
======================================== */
.btn-primary {
    width: 100%;
    padding: clamp(0.75rem, 2vw, 0.9rem);
    background: linear-gradient(
        135deg,
        var(--primary-blue-dark) 0%,
        var(--primary-blue) 100%
    );
    border: none;
    border-radius: 8px;
    color: var(--white);
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transform: translateY(10px);
    opacity: 0;
    animation: slideUpInput 0.4s ease-out 0.8s forwards;
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* ========================================
   PIE DE FORMULARIO
======================================== */
.form-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    opacity: 0;
    animation: fadeIn 0.4s ease-out 0.9s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.login-link a {
    color: var(--primary-blue-light);
    text-decoration: none;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.login-link a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.login-link a:hover::after {
    width: 100%;
}

.login-link a:hover {
    color: var(--primary-blue);
}

.login-link {
    color: var(--slate-400);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
}

.login-link a {
    color: var(--primary-blue-light);
    font-weight: 600;
}

/* ========================================
   MEDIA QUERIES RESPONSIVAS
======================================== */

/* Móviles muy pequeños (0 - 374px) */
@media (max-width: 374px) {
    .email-container {
        flex-direction: column;
    }

    .left-section,
    .right-section {
        flex: none;
        min-height: 50vh;
        padding: var(--spacing-md);
        animation: none;
        transform: none;
        opacity: 1;
    }

    .left-section {
        min-height: 40vh;
    }

    .right-section {
        min-height: 60vh;
    }

    .content-wrapper {
        padding: 0;
        animation: none;
        transform: none;
        opacity: 1;
    }

    .features {
        gap: var(--spacing-sm);
        animation: none;
        opacity: 1;
    }

    .form-group {
        margin-bottom: var(--spacing-md);
        animation: none;
        transform: none;
        opacity: 1;
    }

    .btn-primary,
    .form-footer {
        animation: none;
        transform: none;
        opacity: 1;
    }
}

/* Móviles pequeños (375px - 424px) */
@media (min-width: 375px) and (max-width: 424px) {
    .email-container {
        flex-direction: column;
    }

    .left-section {
        min-height: 42vh;
        padding: var(--spacing-lg);
    }

    .right-section {
        min-height: 58vh;
        padding: var(--spacing-lg);
    }

    .form-header {
        margin-bottom: var(--spacing-lg);
    }
}

/* Móviles medianos (425px - 767px) */
@media (min-width: 425px) and (max-width: 767px) {
    .email-container {
        flex-direction: column;
    }

    .left-section {
        min-height: 45vh;
        padding: var(--spacing-xl);
    }

    .right-section {
        min-height: 55vh;
        padding: var(--spacing-xl);
    }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .email-container {
        flex-direction: column;
    }

    .left-section {
        min-height: 45vh;
        padding: var(--spacing-2xl);
        transform: translateY(-10px);
        animation: slideInTop 0.6s ease-out 0.2s forwards;
    }

    .right-section {
        min-height: 55vh;
        padding: var(--spacing-2xl);
        transform: translateY(10px);
        animation: slideInBottom 0.6s ease-out 0.3s forwards;
    }

    @keyframes slideInTop {
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes slideInBottom {
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

/* Laptops pequeños (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .email-container {
        flex-direction: row;
    }

    .left-section,
    .right-section {
        flex: 1;
        min-height: 100vh;
        padding: var(--spacing-2xl);
    }
}

/* Desktops medianos (1280px - 1439px) */
@media (min-width: 1280px) and (max-width: 1439px) {
    .left-section {
        padding: var(--spacing-3xl);
    }

    .right-section {
        padding: var(--spacing-3xl);
    }
}

/* Desktops grandes (1440px+) */
@media (min-width: 1440px) {
    .content-wrapper {
        max-width: 600px;
    }

    .email-form-wrapper {
        max-width: 500px;
    }
}

/* Orientación landscape en dispositivos móviles */
@media (max-height: 600px) and (orientation: landscape) {
    .email-container {
        flex-direction: row;
    }

    .left-section {
        flex: 0.4;
        min-height: 100vh;
        padding: var(--spacing-lg);
    }

    .right-section {
        flex: 0.6;
        min-height: 100vh;
        padding: var(--spacing-lg);
    }

    .content-wrapper {
        max-width: 100%;
    }

    .features {
        gap: var(--spacing-xs);
    }

    .form-header {
        margin-bottom: var(--spacing-md);
    }

    .form-group {
        margin-bottom: var(--spacing-sm);
    }

    .btn-primary {
        margin-bottom: var(--spacing-sm);
    }
}

/* ========================================
   OPTIMIZACIONES DE ACCESIBILIDAD
======================================== */

/* Pantallas táctiles */
@media (hover: none) {
    .btn-primary:hover,
    .home-button:hover {
        transform: none;
        box-shadow: none;
    }

    .form-input:focus {
        transform: none;
    }

    .login-link a:hover::after {
        width: 0;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 2px;
        border-color: var(--white);
    }

    .form-input:focus {
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5);
    }

    .btn-primary {
        border: 2px solid var(--white);
    }

    .success-alert {
        border-width: 2px;
    }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .floating-shapes {
        display: none;
    }

    .shape {
        animation: none;
    }

    .logo {
        animation: none;
        filter: none;
    }

    .email-container,
    .left-section,
    .right-section,
    .content-wrapper,
    .email-form-wrapper,
    .form-group,
    .btn-primary,
    .form-footer,
    .features {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* ========================================
   UTILIDADES DE DESARROLLO
======================================== */
@media (min-width: 1920px) {
    .content-wrapper {
        max-width: 700px;
    }

    .email-form-wrapper {
        max-width: 600px;
    }
}
