:root {
    --brand-color: #0F172A; /* Deep Navy/Black */
    --accent-color: #2563EB; /* Functional Blue */
    --accent-gradient-start: #3B82F6;
    --accent-gradient-end: #1D4ED8;
    --text-main: #111827;
    --text-sub: #4B5563;
    --border-color: #E5E7EB;
    --bg-page: #F8FAFC; /* Slightly warmer/softer white for modern feel */
    --bg-surface: #FFFFFF;
    --error-color: #EF4444;
    
    /* Modern Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-colored: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    background: var(--bg-surface);
    border-radius: 16px; /* Softer container */
    padding: 32px; /* Inner padding for container */
    box-shadow: var(--shadow-sm);
}

/* Header */
header {
    margin-bottom: 40px;
    text-align: left;
}

header h1 {
    /* Responsive Typography */
    font-size: clamp(1.5rem, 4.5vw, 2rem);
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    
    /* Layout & Spacing */
    line-height: 1.5;
    letter-spacing: -0.02em;
    
    /* Text Wrapping Optimization */
    word-break: keep-all; /* Prevent breaking Korean words */
    overflow-wrap: break-word;
    text-wrap: balance; /* Balance lines aesthetically */
    
    /* Visuals */
    background: linear-gradient(135deg, var(--text-main) 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Title Media Queries for Optimization */
@media (max-width: 768px) {
    header h1 {
        line-height: 1.55; /* More breathing room on mobile */
        letter-spacing: -0.01em;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    header h1 {
        line-height: 1.5;
        letter-spacing: -0.015em;
    }
}

@media (min-width: 1025px) {
    header h1 {
        line-height: 1.4; /* Tighter on large screens */
        letter-spacing: -0.02em;
    }
}

.guide-text {
    font-size: 1rem;
    color: var(--text-sub);
    line-height: 1.6;
}

/* Question Section */
.section {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.show {
    display: block;
}

.question {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.question:last-child {
    border-bottom: none;
}

.question-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 20px;
    display: block;
    line-height: 1.4;
}

/* Modern Radio Options */
.options {
    display: flex;
    gap: 16px;
}

.option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-sub);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

/* Option Hover */
@media (hover: hover) {
    .option:hover span {
        border-color: var(--accent-color);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        color: var(--accent-color);
    }
}

/* Option Checked */
.option input[type="radio"]:checked + span {
    background: linear-gradient(135deg, var(--accent-gradient-start) 0%, var(--accent-gradient-end) 100%);
    color: #FFFFFF;
    border-color: transparent;
    font-weight: 600;
    box-shadow: var(--shadow-colored);
    transform: translateY(-1px);
}

/* Actions */
.actions {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Primary Button - Modern & Tactile */
.primary-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--accent-gradient-start) 0%, var(--accent-gradient-end) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-colored);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.2s;
}

.primary-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.primary-btn:not(:disabled):hover::after {
    opacity: 1;
}

.primary-btn:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.primary-btn:disabled {
    background: #F1F5F9;
    color: #94A3B8;
    box-shadow: none;
    cursor: not-allowed;
    border: 1px solid var(--border-color);
}

/* Secondary Button */
.secondary-btn {
    width: 100%;
    padding: 16px;
    background: transparent;
    color: var(--text-sub);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: #F8FAFC;
    border-color: var(--text-main);
    color: var(--text-main);
    transform: translateY(-1px);
}

/* Footer */
.footer-fixed {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-sub);
    opacity: 0.8;
}

/* Modal - Modern */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4); /* Brand color tint */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #FFFFFF;
    width: 90%;
    max-width: 440px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.1);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.result-section {
    text-align: left;
}

#result-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: -0.02em;
}

.result-message {
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.7;
    margin-bottom: 32px;
    white-space: pre-wrap;
}

/* Result CTA Button Base */
.result-cta-btn {
    display: block;
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--brand-color) 0%, #1E293B 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    font-size: 1.05rem;
    margin-top: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.3);
}

.result-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.4);
    filter: brightness(1.1);
}

/* Result Colors (Distinct from Yes/No Blue) */

/* Result A: Professional Success (Emerald/Teal) */
.result-section.result-success #result-title {
    color: #059669; /* Emerald 600 */
    border-bottom-color: #059669;
}
.result-section.result-success .result-cta-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 14px 0 rgba(5, 150, 105, 0.39);
}
.result-section.result-success .result-cta-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.4);
}

/* Result B: Preparation Needed (Amber/Bronze) */
.result-section.result-warning #result-title {
    color: #D97706; /* Amber 600 */
    border-bottom-color: #D97706;
}
.result-section.result-warning .result-cta-btn {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    box-shadow: 0 4px 14px 0 rgba(217, 119, 6, 0.39);
}
.result-section.result-warning .result-cta-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(217, 119, 6, 0.4);
}

/* Result C: Stop/Danger (Slate/Gray - Cold Authority) */
.result-section.result-danger #result-title {
    color: #475569; /* Slate 600 */
    border-bottom-color: #475569;
}
.result-section.result-danger .result-cta-btn {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 4px 14px 0 rgba(71, 85, 105, 0.39);
}
.result-section.result-danger .result-cta-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(71, 85, 105, 0.4);
}


.modal-close-btn {
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #F1F5F9;
    color: var(--text-main);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Optimization */
@media (max-width: 480px) {
    body { padding: 16px; }
    .container { padding: 24px; border-radius: 16px; }
    /* header h1 font-size is now handled by clamp() in base styles */
    .question-label { font-size: 1rem; }
    .options { gap: 12px; }
    .option span { padding: 14px; }
    .primary-btn, .result-cta-btn { padding: 16px; font-size: 1rem; }
}
