/* =============================================
   ONIROS - Estilos Mobile-First
   Interpretación de Sueños con IA
   ============================================= */

/* Reset y Variables - Paleta onírica y lúdica */
:root {
    --color-primary: #7c3aed;
    --color-primary-dark: #6d28d9;
    --color-secondary: #a855f7;
    --color-accent: #f472b6;
    --color-gradient: linear-gradient(135deg, #4c1d95 0%, #7c3aed 40%, #a855f7 70%, #f472b6 100%);
    --color-gradient-light: linear-gradient(135deg, #ede9fe 0%, #fce7f3 100%);
    --color-text: #1e1245;
    --color-text-light: #554a71;
    --color-text-muted: #8b81a3;
    --color-bg: #faf8ff;
    --color-white: #ffffff;
    --color-card-bg: #f5f3ff;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --shadow-sm: 0 2px 12px rgba(124, 58, 237, 0.08);
    --shadow: 0 6px 24px rgba(124, 58, 237, 0.12);
    --shadow-lg: 0 20px 60px rgba(76, 29, 149, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(244, 114, 182, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(124, 58, 237, 0.03) 0%, transparent 70%);
}

/* =============================================
   HEADER Y NAVEGACIÓN
   ============================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(124, 58, 237, 0.08);
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    display: none;
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Menú hamburguesa */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger {
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: var(--transition);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: var(--transition);
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    bottom: -7px;
}

.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Navegación móvil */
.nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    padding: 16px;
    box-shadow: var(--shadow);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: var(--color-gradient);
    color: var(--color-white);
}

/* =============================================
   CONTENEDOR PRINCIPAL
   ============================================= */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.main {
    flex: 1;
    margin-top: var(--header-height);
}

/* =============================================
   HERO SECTION
   ============================================= */

.hero {
    background: var(--color-gradient);
    color: var(--color-white);
    padding: 56px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 70% 30%, rgba(244, 114, 182, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

/* Estrellas decorativas en el hero */
.hero-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    animation: twinkle 3s ease-in-out infinite;
}

.star-1 { top: 10%; left: 8%; animation-delay: 0s; font-size: 0.7rem; }
.star-2 { top: 18%; left: 20%; animation-delay: 0.6s; font-size: 1rem; }
.star-3 { top: 8%; right: 15%; animation-delay: 1.2s; font-size: 0.8rem; }
.star-4 { top: 30%; right: 10%; animation-delay: 0.3s; font-size: 0.6rem; }
.star-5 { top: 5%; left: 60%; animation-delay: 0.9s; font-size: 1.1rem; }
.star-6 { top: 40%; left: 5%; animation-delay: 1.5s; font-size: 0.5rem; }

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.3); }
}

.hero-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
    position: relative;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    max-width: 620px;
    margin: 0 auto 24px;
    line-height: 1.7;
    position: relative;
}

/* =============================================
   SECCIONES
   ============================================= */

.section {
    padding: 40px 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--color-text);
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '🌙';
    display: block;
    font-size: 1.4rem;
    margin-top: 8px;
}

/* Info Grid */
.section-info {
    background: var(--color-white);
    border-bottom: 1px solid rgba(124, 58, 237, 0.06);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.info-card {
    background: var(--color-card-bg);
    padding: 28px 24px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.info-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: rgba(168, 85, 247, 0.15);
}

.info-icon {
    font-size: 2.8rem;
    margin-bottom: 14px;
}

.info-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-text);
}

.info-card p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* =============================================
   FORMULARIO
   ============================================= */

.section-form {
    background: var(--color-bg);
}

.form-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.form-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-text);
}

.form-info p {
    color: var(--color-text-light);
    margin-bottom: 16px;
    line-height: 1.7;
}

.form-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--color-text);
}

.feature-icon {
    width: 26px;
    height: 26px;
    background: var(--color-gradient);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    font-weight: 700;
}

/* Form Wrapper */
.form-wrapper {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(124, 58, 237, 0.06);
}

.form-wrapper h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--color-text);
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 14px 16px;
    border: 2px solid #e4dcf5;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
    background: var(--color-white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #bbb;
}

.form-group small {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Disclaimer bajo el formulario */
.form-disclaimer {
    margin-top: 20px;
    padding: 16px;
    background: #fef3c7;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--color-warning);
}

.form-disclaimer p {
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 8px;
    line-height: 1.5;
}

.form-disclaimer p:last-child {
    margin-bottom: 0;
}

.form-disclaimer .highlight {
    font-weight: 600;
}

/* =============================================
   BOTONES
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--color-white);
    color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.btn-submit {
    background: var(--color-gradient);
    color: var(--color-white);
    width: 100%;
    position: relative;
    letter-spacing: 0.02em;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.45);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-submit .spinner {
    display: none;
}

.btn-submit.loading .spinner {
    display: block;
}

.btn-submit.loading span {
    display: none;
}

/* Botones de cookies */
.btn-cookie {
    padding: 10px 22px;
    font-size: 0.9rem;
    border-radius: 50px;
}

.btn-accept {
    background: var(--color-gradient);
    color: var(--color-white);
}

.btn-reject {
    background: transparent;
    color: var(--color-text-light);
    border: 2px solid #e0daf0;
}

.btn-reject:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* =============================================
   MENSAJES DE ERROR/ÉXITO
   ============================================= */

.error-message {
    background: #fee;
    color: #c00;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    border-left: 4px solid #c00;
    margin-top: 16px;
}

.success-message {
    background: #efe;
    color: #060;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    border-left: 4px solid #060;
    margin-top: 16px;
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
    background: linear-gradient(180deg, #1e1245 0%, #160a35 100%);
    color: var(--color-white);
    padding: 48px 0 24px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-brand {
    text-align: center;
}

.footer-brand .logo-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.footer-brand .logo-text {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 320px;
    margin: 0 auto;
}

.footer-links,
.footer-legal,
.footer-contact {
    text-align: center;
}

.footer h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 8px;
}

.footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--color-accent);
}

.footer-contact p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
}

/* =============================================
   BANNER DE COOKIES
   ============================================= */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: 0 -4px 24px rgba(124, 58, 237, 0.12);
    padding: 16px;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-content p {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
    line-height: 1.5;
}

.cookie-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* =============================================
   PÁGINAS DE ÉXITO Y CANCELACIÓN
   ============================================= */

.success-container,
.cancel-container {
    text-align: center;
    padding: 40px 20px;
}

.success-icon,
.cancel-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s ease-out;
}

.success-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.cancel-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.success-icon svg,
.cancel-icon svg {
    width: 40px;
    height: 40px;
    stroke: white;
    stroke-width: 3;
    fill: none;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-container h1 {
    color: #10b981;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.cancel-container h1 {
    color: #ef4444;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.success-container p,
.cancel-container p {
    color: var(--color-text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.info-box {
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 24px 0;
}

.success-container .info-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.cancel-container .info-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.success-container .info-box h3 {
    color: #166534;
}

.cancel-container .info-box h3 {
    color: #991b1b;
}

.info-box p {
    font-size: 0.9rem;
    margin: 0;
}

.success-container .info-box p {
    color: #15803d;
}

.cancel-container .info-box p {
    color: #b91c1c;
}

.timer {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 20px 0;
    font-variant-numeric: tabular-nums;
}

.btn-home,
.btn-retry {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    transition: var(--transition);
    margin: 8px;
    text-decoration: none;
}

.btn-retry {
    background: var(--color-gradient);
    color: var(--color-white);
}

.btn-home {
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-retry:hover,
.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

/* =============================================
   PÁGINA GENÉRICA (Términos, Sobre Nosotros, Soporte)
   ============================================= */

.page-header {
    background: var(--color-gradient);
    color: var(--color-white);
    padding: 48px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-secondary), var(--color-accent));
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 1rem;
    opacity: 0.9;
}

.page-content {
    padding: 40px 0;
    background: var(--color-white);
}

.page-content .container {
    max-width: 800px;
}

.page-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-card-bg);
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content p {
    color: var(--color-text-light);
    margin-bottom: 16px;
    line-height: 1.8;
}

.page-content ul {
    color: var(--color-text-light);
    margin-bottom: 16px;
    padding-left: 24px;
    line-height: 1.8;
}

.page-content ul li {
    margin-bottom: 8px;
}

.page-content strong {
    color: var(--color-text);
}

.page-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* =============================================
   ANIMACIONES
   ============================================= */

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner .path {
    stroke: var(--color-white);
    stroke-linecap: round;
    animation: spin 1.2s linear infinite;
    transform-origin: center;
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
}

/* =============================================
   RESPONSIVE - TABLET (768px)
   ============================================= */

@media (min-width: 768px) {
    .logo-text {
        display: inline;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .nav {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: transparent;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        backdrop-filter: none;
    }
    
    .nav-list {
        flex-direction: row;
        gap: 6px;
    }
    
    .nav-link {
        padding: 8px 18px;
        border-radius: 50px;
    }
    
    .hero {
        padding: 72px 24px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-layout {
        grid-template-columns: 1fr 1fr;
        gap: 48px;
        align-items: start;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .footer-brand,
    .footer-links,
    .footer-legal,
    .footer-contact {
        text-align: left;
    }
    
    .footer-brand p {
        margin: 0;
    }
    
    .cookie-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
    }
    
    .cookie-content p {
        margin-bottom: 0;
        flex: 1;
    }
    
    .cookie-buttons {
        flex-shrink: 0;
    }
    
    .page-header {
        padding: 64px 24px;
    }
    
    .page-header h1 {
        font-size: 2.25rem;
    }
}

/* =============================================
   RESPONSIVE - DESKTOP (1024px)
   ============================================= */

@media (min-width: 1024px) {
    .header-container {
        padding: 0 24px;
    }
    
    .container {
        padding: 0 24px;
    }
    
    .hero {
        padding: 88px 32px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 48px;
    }
    
    .section-title::after {
        font-size: 1.6rem;
    }
    
    .form-wrapper {
        padding: 36px;
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
    
    .success-container h1,
    .cancel-container h1 {
        font-size: 2rem;
    }
    
    .timer {
        font-size: 4rem;
    }
    
    .page-header {
        padding: 80px 32px;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
}

/* =============================================
   UTILIDADES
   ============================================= */

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}