:root {
    /* Avida Fertility Brand Colors */
    --brand-purple: #614055;
    --brand-olive: #B9C9B2;
    --brand-black: #1D1D1B;
    --brand-background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
    --brand-soft-purple: rgba(97, 64, 85, 0.08);
    --brand-accent: rgba(185, 201, 178, 0.15);
    --text-dark: #1D1D1B; 
    --text-light: #5c5c5c;
    --shadow-primary: 0 20px 25px -5px rgba(97, 64, 85, 0.1), 0 10px 10px -5px rgba(97, 64, 85, 0.04);
    --shadow-secondary: 0 4px 6px -1px rgba(97, 64, 85, 0.1), 0 2px 4px -1px rgba(97, 64, 85, 0.06);
    --gradient-primary: linear-gradient(135deg, var(--brand-purple) 0%, #7a5a6b 100%);
    --gradient-accent: linear-gradient(135deg, var(--brand-olive) 0%, #a8b8a0 100%);
}

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--brand-background); 
    color: var(--text-dark);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(185, 201, 178, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(97, 64, 85, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.step-container { 
    display: none; 
    text-align: center; 
    animation: fadeIn 0.5s ease-in-out; 
}

.step-container.active { 
    display: block; 
}

@keyframes fadeIn { 
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

.option-button { 
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%); 
    border: 1.5px solid #e5e7eb; 
    color: var(--text-dark); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative;
    box-shadow: var(--shadow-secondary);
    backdrop-filter: blur(10px);
}

.option-button.selected {
    border-color: var(--brand-purple);
    background: linear-gradient(145deg, var(--brand-soft-purple) 0%, rgba(97, 64, 85, 0.12) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.option-button.selected::after {
    content: '✔';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-purple);
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(97, 64, 85, 0.2);
}

.custom-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center; 
    background-repeat: no-repeat; 
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; 
    -webkit-appearance: none; 
    -moz-appearance: none; 
    appearance: none;
}

.info-note { 
    max-height: 0; 
    overflow: hidden; 
    transition: all 0.4s ease-in-out; 
    opacity: 0; 
}

.info-note.visible { 
    max-height: 200px; 
    opacity: 1; 
    margin-top: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* --- ESTILOS MEJORADOS PARA LA BARRA DE PROGRESO --- */
.progress-segment {
    height: 100%;
    flex-grow: 1;
    background-color: #e5e7eb; /* Gris para pasos futuros */
    border-radius: 9999px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-segment.completed {
    background-color: var(--brand-purple); /* Morado para pasos completados */
}

.progress-segment.active {
    background-color: var(--brand-olive); /* Verde oliva para el paso actual */
    transform: scaleY(1.5); /* Lo hace más alto para destacarlo */
    box-shadow: 0 0 8px rgba(185, 201, 178, 0.9); /* Efecto de brillo */
}
/* --- FIN DE ESTILOS MEJORADOS --- */

.iti { 
    width: 100%; 
}

.error-message { 
    color: #EF4444; 
    font-size: 0.875rem; 
    margin-top: 0.25rem; 
    display: none; 
}

.input-error { 
    border-color: #EF4444 !important; 
}

.accordion-content { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.3s ease-out; 
}

.tooltip { 
    position: relative; 
    display: inline-block; 
    cursor: pointer; 
}

.tooltip .tooltiptext { 
    visibility: hidden; 
    width: 220px; 
    background-color: #555; 
    color: #fff; 
    text-align: center; 
    border-radius: 6px; 
    padding: 8px; 
    position: absolute; 
    z-index: 10; 
    bottom: 125%; 
    left: 50%; 
    margin-left: -110px; 
    opacity: 0; 
    transition: opacity 0.3s; 
    font-weight: normal; 
}

.tooltip:hover .tooltiptext { 
    visibility: visible; 
    opacity: 1; 
}

.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(0,0,0,0.5); 
    display: none;
    justify-content: center; 
    align-items: center; 
    z-index: 50;
}

.modal-content {
    background-color: white; 
    padding: 2rem; 
    border-radius: 1rem;
    max-width: 400px; 
    width: 90%; 
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-out;
}

/* Loading spinner */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--brand-purple);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Results styling */
.result-card {
    background: linear-gradient(135deg, var(--brand-soft-purple) 0%, white 100%);
    border: 2px solid var(--brand-purple);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.success-rate {
    font-size: 3rem;
    font-weight: bold;
    color: var(--brand-purple);
    text-align: center;
    margin: 1rem 0;
}

.confidence-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.confidence-alto {
    background-color: #10B981;
    color: white;
}

.confidence-medio {
    background-color: #F59E0B;
    color: white;
}

.confidence-bajo {
    background-color: #EF4444;
    color: white;
}

.factors-list {
    text-align: left;
    margin: 1rem 0;
}

.factors-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.factors-list li:last-child {
    border-bottom: none;
}

.positive-factor {
    color: #10B981;
}

.risk-factor {
    color: #EF4444;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Accordion content animation */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(29, 29, 27, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-primary);
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Progress bar styles */
.progress-segment {
    flex: 1;
    height: 6px;
    background: rgba(185, 201, 178, 0.2);
    border-radius: 3px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-segment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(185, 201, 178, 0.1) 0%, 
        rgba(185, 201, 178, 0.3) 50%, 
        rgba(185, 201, 178, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-segment.active {
    background: var(--gradient-primary);
    transform: scaleY(1.5);
    box-shadow: 0 0 10px rgba(97, 64, 85, 0.3);
}

.progress-segment.active::before {
    opacity: 1;
    animation: shimmer 2s infinite;
}

.progress-segment.completed {
    background: var(--gradient-accent);
    transform: scaleY(1.2);
}

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

/* Landing Page Styles */
html {
    scroll-behavior: smooth;
}

/* Sticky navigation bar enhancement */
@media (max-width: 768px) {
    .hero-cta-button {
        font-size: 1rem !important;
        padding: 1rem 2rem !important;
    }
}

/* CTA button pulse animation for increased attention */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(185, 201, 178, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(185, 201, 178, 0);
    }
}

.cta-pulse {
    animation: pulse-glow 2s infinite;
}

/* Enhanced focus states for accessibility and conversion */
button:focus-visible,
a:focus-visible {
    outline: 3px solid #B9C9B2;
    outline-offset: 2px;
}

/* Question emphasis - make user actions stand out */
.step-container h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--brand-purple);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.step-container p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.125rem;
    line-height: 1.6;
    font-weight: 500;
}

/* Make input fields and buttons more prominent */
.option-button {
    font-size: 1.125rem !important;
    padding: 1.25rem 1.5rem !important;
    font-weight: 600 !important;
    min-height: 60px;
}

.custom-select,
input[type="number"],
input[type="email"],
input[type="text"] {
    font-size: 1.125rem !important;
    padding: 1rem 1.25rem !important;
    font-weight: 500 !important;
    min-height: 56px;
}

/* Special padding for phone input with flag */
input[type="tel"] {
    font-size: 1.125rem !important;
    padding: 1rem 1.25rem 1rem 4rem !important;
    font-weight: 500 !important;
    min-height: 56px;
}

/* Mobile-first responsive enhancements */
@media (max-width: 640px) {
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 1.875rem !important;
        line-height: 2.25rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }
    
    h3 {
        font-size: 1.125rem !important;
    }
    
    .text-xl {
        font-size: 1.125rem !important;
        line-height: 1.75rem !important;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }
    
    /* Improve button sizing on mobile */
    button, a.inline-flex {
        min-height: 44px;
    }
    
    /* Better spacing on mobile */
    .py-16 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Grid adjustments */
    .grid {
        gap: 1.5rem !important;
    }
    
    /* Calculator specific mobile optimizations */
    #navigation-header {
        padding: 0.75rem !important;
    }
    
    #navigation-header img {
        height: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    #content-area {
        padding: 1.5rem !important;
        min-height: 300px !important;
    }
    
    #disclaimer-footer {
        padding: 0.75rem !important;
    }
    
    /* Reduce spacing before calculator section on mobile */
    #calculator-section {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    #calculator-section .mb-8 {
        margin-bottom: 0.75rem !important;
    }
    
    #calculator-section h2 {
        margin-bottom: 0.5rem !important;
    }
    
    /* Keep questions prominent but compact on mobile */
    .step-container {
        padding: 0 !important;
    }
    
    .step-container h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1.25rem !important;
        font-weight: 800 !important;
    }
    
    .step-container p {
        font-size: 1rem !important;
        margin-bottom: 1.25rem !important;
    }
    
    /* Keep buttons prominent but fit better on mobile */
    .option-button {
        padding: 1rem !important;
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
        min-height: 54px !important;
    }
    
    .custom-select,
    input[type="number"],
    input[type="email"],
    input[type="text"] {
        font-size: 1rem !important;
        padding: 0.875rem 1rem !important;
        min-height: 52px !important;
    }
    
    /* Special padding for phone on mobile */
    input[type="tel"] {
        font-size: 1rem !important;
        padding: 0.875rem 1rem 0.875rem 3.5rem !important;
        min-height: 52px !important;
    }
    
    /* Reduce gaps in button grids and checkbox lists */
    .space-y-3 > * + * {
        margin-top: 0.375rem !important;
    }
    
    /* Compact info notes on mobile */
    .info-note.visible {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
        padding: 0.625rem !important;
        max-height: 150px !important;
    }
    
    /* Compact disclaimer footer text */
    #disclaimer-footer p {
        font-size: 0.625rem !important;
        line-height: 1.3 !important;
    }
    
    /* Optimize checkbox questions for mobile */
    label:has(input[type="checkbox"]) {
        padding: 0.625rem !important;
        font-size: 0.875rem !important;
    }
    
    label:has(input[type="checkbox"]) span {
        font-size: 0.875rem !important;
        margin-left: 0.625rem !important;
    }
    
    label:has(input[type="checkbox"]) input[type="checkbox"] {
        width: 1.125rem !important;
        height: 1.125rem !important;
    }
    
    /* Make content area scrollable for long questions */
    #content-area {
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    /* Allow main container to scroll if needed */
    #main-container {
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

/* Ensure calculator section is visible when scrolled to */
#calculator-section {
    scroll-margin-top: 2rem;
}
