/* ========================================
   VARIABLES Y RESET
   ======================================== */
:root {
    /* Colores principales */
    --primary-purple: #7B2CBF;
    --primary-purple-dark: #5A189A;
    --primary-purple-light: #9D4EDD;
    --accent-pink: #E0AAFF;
    --accent-orange: #FF6B35;
    
    /* Colores de fondo */
    --bg-dark: #0A0A0F;
    --bg-gradient-start: #1A0B2E;
    --bg-gradient-end: #16213E;
    
    /* Colores de texto */
    --text-primary: #FFFFFF;
    --text-secondary: #C5C5D8;
    --text-disabled: #7A7A8C;
    
    /* Otros colores */
    --error-color: #FF4757;
    --success-color: #2ED573;
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.2);
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(123, 44, 191, 0.3);
    --shadow-glow: 0 0 40px rgba(123, 44, 191, 0.5);
    
    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/image-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: -1;
}

/* ========================================
   BACKGROUND OVERLAY
   ======================================== */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(123, 44, 191, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    padding: 0 0 0.5rem 0;
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(123, 44, 191, 0.4));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 20px rgba(123, 44, 191, 0.6));
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    animation: fadeIn 1s ease-out;
}

/* ========================================
   COLLAGE
   ======================================== */
.collage-container {
    width: 100%;
    max-width: 320px;
    position: relative;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.collage-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: float 6s ease-in-out infinite;
}

.collage-image:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 12px 48px rgba(123, 44, 191, 0.5);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========================================
   TITLE
   ======================================== */
.main-title {
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--accent-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.25rem 0;
    animation: fadeInUp 1s ease-out 0.4s both;
    text-shadow: 0 2px 20px rgba(123, 44, 191, 0.3);
}

/* ========================================
   SUBSCRIPTION SECTION
   ======================================== */
.subscription-section {
    width: 100%;
    max-width: 380px;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.description {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0.75rem;
}

/* ========================================
   FORM
   ======================================== */
.form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--input-border);
    border-radius: 16px;
    padding: 0 var(--spacing-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

.input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-purple-light);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(123, 44, 191, 0.2);
}

.input-wrapper:focus-within::before {
    left: 100%;
}

.input-wrapper.error {
    border-color: var(--error-color);
    animation: shake 0.5s ease;
}

.input-wrapper.success {
    border-color: var(--success-color);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.phone-prefix {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: var(--spacing-xs);
}

.phone-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 500;
    padding: 0.875rem 0;
    font-family: var(--font-family);
}

.phone-input::placeholder {
    color: var(--text-disabled);
}

.error-message {
    font-size: 0.813rem;
    color: var(--error-color);
    padding-left: var(--spacing-sm);
    min-height: 1.2rem;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* ========================================
   CTA BUTTON
   ======================================== */
.cta-button {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-dark) 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 16px;
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-purple-light) 0%, var(--primary-purple) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cta-button:hover::before {
    opacity: 1;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:disabled {
    background: var(--input-bg);
    color: var(--text-disabled);
    cursor: not-allowed;
    box-shadow: none;
}

.cta-button:disabled:hover {
    transform: none;
}

.button-text,
.button-icon {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.cta-button:hover .button-icon {
    transform: translateX(5px);
}

.button-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    pointer-events: none;
}

.cta-button.ripple-effect .button-ripple {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Efecto de pulsación */
@keyframes pulse {
    0%, 100% {
        box-shadow: var(--shadow-lg);
    }
    50% {
        box-shadow: var(--shadow-glow);
    }
}

.cta-button.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   DISCLAIMER
   ======================================== */
.disclaimer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    padding: 0.5rem 0;
    text-align: center;
    font-size: 0.688rem;
    color: var(--text-disabled);
    animation: fadeIn 1s ease-out 0.8s both;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        padding: var(--spacing-lg);
    }
    
    .logo {
        height: 80px;
    }
    
    .collage-container {
        max-width: 500px;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .subscription-section {
        max-width: 450px;
    }
    
    .description {
        font-size: 1rem;
    }
}

/* ========================================
   RESPONSIVE - DESKTOP
   ======================================== */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-xl);
        padding: var(--spacing-xl);
    }
    
    .header {
        position: absolute;
        top: var(--spacing-lg);
        left: 50%;
        transform: translateX(-50%);
    }
    
    .logo {
        height: 100px;
    }
    
    .main-content {
        flex-direction: row;
        gap: var(--spacing-xl);
        max-width: 1100px;
        margin: 0 auto;
    }
    
    .collage-container {
        max-width: 550px;
        flex-shrink: 0;
    }
    
    .subscription-section {
        max-width: 480px;
        text-align: left;
    }
    
    .main-title {
        font-size: 3rem;
        text-align: left;
        margin: 0 0 var(--spacing-md) 0;
    }
    
    .description {
        text-align: left;
        font-size: 1.063rem;
    }
    
    .disclaimer {
        text-align: left;
    }
    
    .footer {
        position: absolute;
        bottom: var(--spacing-lg);
        left: 50%;
        transform: translateX(-50%);
        padding: 0;
    }
}

/* ========================================
   RESPONSIVE - LARGE DESKTOP
   ======================================== */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .main-content {
        gap: 5rem;
    }
    
    .collage-container {
        max-width: 650px;
    }
    
    .main-title {
        font-size: 3.5rem;
    }
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mejora del foco para teclado */
*:focus-visible {
    outline: 2px solid var(--primary-purple-light);
    outline-offset: 4px;
}

/* ========================================
   LOADING STATE
   ======================================== */
.cta-button.loading {
    pointer-events: none;
}

.cta-button.loading .button-text {
    opacity: 0;
}

.cta-button.loading .button-icon {
    opacity: 0;
}

.cta-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
