/* ============================================
   PHYSIOLUNG - CALCULADORA RBD
   Diseño Premium Glassmorphism
   ============================================ */

/* VARIABLES GLOBALES */
:root {
    /* Brand Colors */
    --primary: #004aad;
    --primary-light: #e8f4fd;
    --primary-dark: #003380;
    --primary-glow: rgba(0, 74, 173, 0.3);

    --accent: #EFB644;
    --accent-light: #fff8e1;
    --accent-dark: #d9a339;

    --btn-primary: #6C5CE7;
    --btn-primary-hover: #5341D9;
    --btn-glow: rgba(108, 92, 231, 0.4);

    /* Interpretation Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #065f46;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #991b1b;

    /* Light Mode Backgrounds */
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-strong: rgba(255, 255, 255, 0.9);
    --bg-gradient: linear-gradient(135deg, #004aad 0%, #0066cc 100%);
    --bg-hero: linear-gradient(180deg, #e8f4fd 0%, #ffffff 100%);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Borders & Glass */
    --border-light: rgba(0, 0, 0, 0.06);
    --border-glass: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(20px);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --shadow-btn: 0 4px 15px var(--btn-glow);

    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
}

/* RESET Y BASE */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

/* UTILITY CLASSES */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 48px;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--btn-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--duration-fast);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--btn-primary);
    color: var(--text-white);
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--btn-glow);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(239, 182, 68, 0.4);
}

.btn-accent:hover {
    background: var(--accent-dark);
    transform: translateY(-3px);
}

.btn-outline {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border: 2px solid var(--border-light);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-white);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all var(--duration-normal);
}

.navbar.scrolled {
    background: var(--bg-glass-strong);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-md);
    padding: 12px 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    height: 40px;
    transition: transform var(--duration-normal);
}

.nav-logo:hover img {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--duration-fast);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-cta {
    margin-left: 16px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* HERO SECTION */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 120px 0 60px;
    background: var(--bg-hero);
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.hero-shape-1 {
    width: 500px;
    height: 500px;
    background: var(--primary-light);
    top: -150px;
    right: -100px;
}

.hero-shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-light);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-5deg); }
    75% { transform: translate(20px, 10px) rotate(3deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--btn-primary) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-size: 2rem;
    box-shadow: var(--shadow-lg);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 24px;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-white);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: var(--shadow-md);
}

.hero-badge i {
    color: var(--primary);
}

/* CALCULATOR SECTION */
.calculator-section {
    padding: 60px 0 80px;
}

.calc-container {
    max-width: 1100px;
    margin: 0 auto;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.calc-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

/* Calculator Header */
.calc-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.calc-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--btn-primary) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.calc-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.calc-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Info Box */
.calc-info {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.calc-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.calc-info-text {
    font-size: 0.85rem;
    color: var(--primary-dark);
    line-height: 1.6;
}

/* Form Inputs */
.calc-form-group {
    margin-bottom: 24px;
}

.calc-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.calc-label-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calc-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    background: #e5e7eb;
    color: #4b5563;
}

.calc-badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.calc-badge-gold {
    background: var(--accent-light);
    color: #92400e;
}

.calc-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.calc-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.1);
}

.calc-input::placeholder {
    color: #9ca3af;
}

.calc-help {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Results Section */
.results-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.result-box {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.result-box:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-box-main {
    background: linear-gradient(135deg, var(--primary-light) 0%, #bfdbfe 100%);
    border-color: var(--primary);
}

.result-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
}

.result-label i,
.result-label svg {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

.result-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-value-main {
    color: var(--primary);
}

.result-formula {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Interpretation Box */
.result-box-interpretation {
    display: none;
    background: #f9fafb;
}

.result-box-interpretation.show {
    display: block;
}

.interpretation-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.interpretation-positivo {
    background: var(--success-light);
    color: var(--success-dark);
    border: 2px solid var(--success);
}

.interpretation-negativo {
    background: var(--danger-light);
    color: var(--danger-dark);
    border: 2px solid var(--danger);
}

/* Criteria Section */
.criteria-section {
    background: #f9fafb;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 24px;
}

.criteria-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.criteria-header i {
    color: var(--primary);
}

.criteria-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: white;
    border: 2px solid #e5e7eb;
    margin-bottom: 12px;
}

.criteria-item:last-child {
    margin-bottom: 0;
}

.criteria-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.criteria-positivo .criteria-icon {
    background: var(--success-light);
    color: var(--success-dark);
}

.criteria-negativo .criteria-icon {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.criteria-content strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.criteria-content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* LEAD CAPTURE SECTION */
.lead-section {
    background: var(--bg-gradient);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.lead-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.lead-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.lead-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-size: 1.8rem;
}

.lead-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.lead-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.lead-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    transition: all 0.3s ease;
}

.lead-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.lead-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.2);
}

.lead-btn {
    background: var(--accent);
    color: var(--text-primary);
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lead-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.lead-privacy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 16px;
}

.lead-privacy i {
    margin-right: 6px;
}

/* Honeypot */
.website-check-field {
    position: absolute;
    left: -9999px;
}

/* CTA SECTION */
.cta-section {
    padding: 80px 0;
    background: var(--bg-body);
}

.cta-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--btn-primary), var(--accent));
}

.cta-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.cta-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.cta-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* FOOTER */
.footer {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.7);
    padding: 48px 0 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-logo img {
    height: 36px;
    opacity: 0.9;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85rem;
}

/* ADMIN LEAD BADGE */
.admin-lead-badge {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: none;
}

.admin-lead-badge.visible {
    display: block;
}

.admin-lead-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--btn-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 32px rgba(108, 92, 231, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.admin-lead-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(108, 92, 231, 0.5);
}

.admin-lead-count {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ANIMATIONS */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 12px 0;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-cta {
        display: none;
    }
    
    .hero {
        padding: 100px 0 50px;
        min-height: auto;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .calc-card {
        padding: 24px;
    }
    
    .result-value {
        font-size: 1.8rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .admin-lead-badge {
        bottom: 20px;
        right: 20px;
    }
    
    .admin-lead-btn {
        width: 54px;
        height: 54px;
        font-size: 1.3rem;
    }
}
