/* ===== CSS Variables ===== */
:root {
    --primary: #29B5E8;
    --primary-dark: #1E90B8;
    --primary-light: #5FCBF0;
    --accent: #FF6B35;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    
    --bg-dark: #0D1B2A;
    --bg-darker: #0A1421;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --border: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(41, 181, 232, 0.5);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(41, 181, 232, 0.2);
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Background Effects ===== */
.app-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(41, 181, 232, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 80% at 80% 90%, rgba(41, 181, 232, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(10, 20, 33, 0.95) 0%, var(--bg-dark) 100%);
    pointer-events: none;
    z-index: 0;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(rgba(41, 181, 232, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.floating-snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -50px;
    left: var(--x);
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(41, 181, 232, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: fall 15s linear infinite;
    animation-delay: var(--delay);
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===== Pages ===== */
.page {
    display: none;
    width: 100%;
    max-width: 600px;
    z-index: 1;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

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

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

@media (max-width: 640px) {
    .card {
        padding: 24px;
        border-radius: var(--radius-md);
    }
}

/* ===== Landing Page ===== */
.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.snowflake-logo {
    width: 80px;
    height: 80px;
    color: var(--primary);
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(41, 181, 232, 0.4));
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(41, 181, 232, 0.4));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 30px rgba(41, 181, 232, 0.6));
    }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
    letter-spacing: 0.1em;
}

/* ===== Forms ===== */
.customer-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.required {
    color: var(--accent);
}

input, select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    outline: none;
}

input::placeholder {
    color: var(--text-muted);
}

input:hover, select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

input:focus, select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41, 181, 232, 0.15);
}

input.error, select.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.error-message {
    display: block;
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 4px;
    min-height: 18px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(41, 181, 232, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(41, 181, 232, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-large {
    width: 100%;
    padding: 16px 32px;
    font-size: 1rem;
}

/* ===== Question Page ===== */
.question-card {
    text-align: center;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
    box-shadow: 0 0 10px rgba(41, 181, 232, 0.5);
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.question-container {
    margin-bottom: 40px;
}

.question-number {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(41, 181, 232, 0.1);
    border-radius: var(--radius-full);
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 12px;
}

@media (max-width: 480px) {
    .question-text {
        font-size: 1.25rem;
    }
}

.question-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== Answer Buttons ===== */
.answer-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

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

.btn-answer {
    flex-direction: column;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.btn-answer svg {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
}

.btn-answer:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-answer.selected {
    transform: scale(1.02);
}

.btn-yes.selected {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.btn-no.selected {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error);
    color: var(--error);
}

.btn-unknown.selected {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    color: var(--warning);
}

/* ===== Navigation Buttons ===== */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* ===== Summary Page ===== */
.summary-header {
    text-align: center;
    margin-bottom: 32px;
}

.summary-header .check-icon {
    width: 64px;
    height: 64px;
    color: var(--success);
    margin-bottom: 16px;
}

.summary-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.summary-header p {
    color: var(--text-secondary);
}

.summary-content {
    margin-bottom: 32px;
}

.summary-section {
    margin-bottom: 24px;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.summary-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .summary-info {
        grid-template-columns: 1fr;
    }
}

.summary-info-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.summary-info-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.summary-info-item .value {
    font-weight: 500;
    color: var(--text-primary);
}

.summary-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.summary-answers::-webkit-scrollbar {
    width: 4px;
}

.summary-answers::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.summary-answers::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.answer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    gap: 12px;
}

.answer-item .question {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex: 1;
}

.answer-badge {
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.answer-badge.yes {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.answer-badge.no {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.answer-badge.unknown {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.answer-badge.skipped {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== Success Page ===== */
.success-card {
    text-align: center;
    padding: 60px 40px;
}

.success-animation {
    margin-bottom: 24px;
}

.success-checkmark {
    width: 80px;
    height: 80px;
}

.checkmark-circle {
    stroke: var(--success);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: var(--success);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.success-card h1 {
    font-size: 1.75rem;
    color: var(--success);
    margin-bottom: 8px;
}

.success-card p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.success-subtext {
    font-size: 0.875rem;
    color: var(--text-muted) !important;
    margin-bottom: 32px !important;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 27, 42, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(41, 181, 232, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 200;
    opacity: 0;
    transition: all var(--transition-normal);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--error);
    color: var(--error);
}

.toast.success {
    border-color: var(--success);
    color: var(--success);
}
