/* Design Tokens & Custom Properties */
:root {
    --bg-color: #FAFAF7;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-color: #2c2825;
    --text-muted: #6e655f;
    --primary-color: #476a56; /* Verde consultorio elegante */
    --primary-hover: #375343;
    --primary-light: #e8eee9;
    --accent-color: #d18a68; /* Terracota cálido */
    --accent-hover: #b87352;
    --ink-color: #1a1716; /* Tinta negra orgánica */
    --border-color: rgba(71, 106, 86, 0.15);
    --success-color: #2e7d32;
    --success-light: #e8f5e9;
    --decline-color: #8c7a6b;
    --decline-bg: rgba(140, 122, 107, 0.06);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-soft: 0 10px 30px rgba(44, 40, 37, 0.05);
    --shadow-medium: 0 20px 40px rgba(44, 40, 37, 0.08);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Typography Standardization */
    --fs-h1: 2.75rem;
    --fs-h2: 2rem;
    --fs-h3: 1.4rem;
    --fs-body: 1.1rem;
    --fs-small: 0.95rem;
    --spacing-title: 0.5rem;
    --spacing-section: 1.5rem;
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    position: relative;
}

/* Decorative Background Shapes */
.decorations {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background-color: var(--primary-light);
    top: -100px;
    right: -100px;
    animation: floatShape 20s infinite ease-in-out;
}

.shape-2 {
    width: 350px;
    height: 350px;
    background-color: rgba(209, 138, 104, 0.2);
    bottom: -50px;
    left: -100px;
    animation: floatShape 25s infinite ease-in-out reverse;
}

.shape-3 {
    width: 280px;
    height: 280px;
    background: rgba(71, 106, 86, 0.08);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatShape 18s infinite ease-in-out 3s;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-15px, 25px) scale(0.95); }
    75% { transform: translate(20px, 15px) scale(1.02); }
}

/* Main Container */
.app-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* Screen States (Transitions) */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 850px;
    backface-visibility: hidden;
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.screen.fading-out {
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Cards (Glassmorphism) */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    padding: 3rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

@media (max-width: 600px) {
    .card {
        padding: 2rem 1.5rem;
    }
}

/* Badges & Headers */
.badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.badge.success {
    background-color: var(--success-light);
    color: var(--success-color);
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-title);
    color: var(--text-color);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
    font-size: var(--fs-body);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.welcome-body strong {
    color: var(--primary-color);
}

/* Accent styling for "Manso" in the title */
.title-accent {
    display: block;
    font-style: italic;
    color: var(--accent-color);
    font-size: 2.2rem;
    font-weight: 400;
    margin-top: 0.1rem;
}

.subtitle {
    font-size: var(--fs-body);
    color: var(--text-muted);
    margin-bottom: var(--spacing-section);
}

/* Session Info Table */
.session-info {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-row .label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.info-row .val {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--primary-color);
}

/* Evaluator Instagram link */
.evaluator-link {
    text-decoration: none;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    border-bottom: 1px dashed transparent;
}

.evaluator-link:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

.ig-icon {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.evaluator-link:hover .ig-icon {
    opacity: 1;
}

/* Welcome Body */
.welcome-body {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 2.5rem;
}

.welcome-body p {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(71, 106, 86, 0.25);
}

.btn.success {
    background-color: var(--success-color);
    color: white;
}

.btn.success:hover {
    background-color: #246227;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.25);
}

.btn.large {
    width: 100%;
    padding: 1.25rem 2rem;
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Decline Button */
.btn.decline-card {
    text-align: center;
}

.decline-card .btn {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

.btn.decline {
    background: transparent;
    color: var(--decline-color);
    border: 1px solid rgba(140, 122, 107, 0.25);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.85rem 1.5rem;
    box-shadow: none;
    width: 100%;
}

.btn.decline:hover {
    background: var(--decline-bg);
    border-color: rgba(140, 122, 107, 0.4);
    transform: none;
    box-shadow: none;
}

/* Divider section ("o bien") */
.divider-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.75rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: rgba(140, 122, 107, 0.15);
}

.divider-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
}

/* Spinner Icon */
.spinner-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: spinSlow 3s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    line-height: 1;
    transform-origin: center center;
}

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

.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 600px) {
    .action-buttons-grid {
        grid-template-columns: 1fr;
    }
}

/* Decline final screen */
.decline-final-card {
    text-align: center;
    max-width: 550px;
    margin: 0 auto;
    padding: 3.5rem 3rem;
}

.decline-final-emoji {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: gentleBounce 2s ease-in-out infinite;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.decline-final-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.decline-final-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.decline-final-signature {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    height: 10px;
    border-radius: 50px;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 50px;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.manso-accent {
    font-size: 1.6em;
    display: block;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

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

.progress-text {
    position: absolute;
    right: 15px;
    top: -25px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Test Layout */
.test-layout.vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

/* Question Header */
.question-header {
    width: 100%;
    text-align: center;
    padding-top: 1rem;
}

.question-title {
    font-size: var(--fs-h2);
    color: var(--primary-color);
    margin: 0;
    margin-bottom: var(--spacing-title);
    font-family: var(--font-heading);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Inkblot Canvas */
.stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
}

#blot {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Options as beautiful interactive cards */
.option-card {
    background: white;
    border: 1px solid rgba(71, 106, 86, 0.12);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(44, 40, 37, 0.02);
    min-height: 80px;
}

.option-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

.option-card.selected {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(71, 106, 86, 0.12);
}

.option-card.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px 0 0 4px;
}

/* Circle marker for options */
.option-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-card.selected .option-marker {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.option-card.selected .option-marker::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

.option-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.4;
}

/* Diagnosis Screen Styling */
.diagnosis-card {
    max-width: 750px;
    margin: 0 auto;
}

.centered {
    text-align: center;
}

.diagnosis-report {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
}

.report-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
}

.report-box h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.5rem;
}

.report-box p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* Prescription & Plan Selectors */
.prescription {
    border-left: 4px solid var(--accent-color);
}

.prescription-warning {
    font-size: 0.9rem !important;
    color: var(--accent-color) !important;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.prescription-plans {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Plan card list */
.plan-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-color);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(71, 106, 86, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-item:hover {
    background: var(--primary-light);
}

.plan-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.plan-label {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    flex-grow: 1;
}

/* Whatsapp confirmation card */
.whatsapp-card {
    background: var(--success-light);
    border: 1px solid rgba(46, 125, 50, 0.2);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: 0 6px 15px rgba(46, 125, 50, 0.05);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.whatsapp-info {
    flex: 1;
}

.whatsapp-action {
    flex: 1;
    display: flex;
    justify-content: center;
}

.whatsapp-card h3 {
    color: var(--success-color);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.whatsapp-card p {
    font-size: 1rem;
    color: #3e5340;
    margin-bottom: 0;
}

.whatsapp-credit {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.whatsapp-credit a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.whatsapp-credit a:hover {
    color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.whatsapp-icon {
    width: 24px;
    height: 24px;
}

/* Footer styling */
.app-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid rgba(71, 106, 86, 0.08);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-footer p {
    font-size: 0.65rem;
    margin-bottom: 0;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}
.diagnosis-content {
    font-size: var(--fs-body, 1.1rem);
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.diagnosis-item {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(71, 106, 86, 0.1);
    line-height: 1.7;
}

.diagnosis-item:last-child {
    border-bottom: none;
    margin-bottom: 1rem;
}

.alert-box {
    background-color: rgba(140, 122, 107, 0.08);
    border-left: 4px solid var(--accent-color);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 1.25rem;
    font-size: inherit;
    line-height: inherit;
    color: var(--text-color);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .title-accent {
        font-size: 1.4rem;
    }
    
    .card {
        padding: 1.5rem 1rem;
    }
    
    .question-container {
        padding: 1rem;
    }
    
    .question-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .stage {
        max-height: 250px;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .option-card {
        padding: 0.8rem 1rem;
        min-height: 60px;
        gap: 0.75rem;
    }
    
    .option-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .decline-final-card {
        padding: 2rem 1.5rem;
    }
    
    .decline-final-emoji {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .whatsapp-card {
        flex-direction: column;
        text-align: center;
    }

    .whatsapp-action {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: none;
        padding: 0.85rem 1rem;
    }
    
    .diagnosis-content {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    .welcome-body p {
        margin-bottom: 0.75rem;
        font-size: 0.9rem;
    }
    
    .welcome-body strong {
        font-size: 0.85rem;
    }
}
