:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #FFD93D 0%, #FF6B6B 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.gradient-primary {
    background: var(--gradient-primary);
}

.gradient-accent {
    background: var(--gradient-accent);
}

.glass-morphism {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    will-change: transform;
    transform: translateZ(0); /* GPU acceleration */
}

.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-responsive-huge {
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 0.85;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.text-responsive-large {
    font-size: clamp(1.5rem, 4vw, 2.8rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.text-responsive-medium {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    line-height: 1.4;
    font-weight: 600;
}

.text-responsive-small {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
    line-height: 1.5;
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.gentle-pulse {
    animation: gentle-pulse 2s ease-in-out infinite;
}

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

@keyframes gentle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.stagger-animation {
    animation: fade-in-up 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 접근성: "동작 줄이기" 설정 시 애니메이션 비활성화 및 즉시 표시 */
@media (prefers-reduced-motion: reduce) {
    .stagger-animation {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    /* 다른 애니메이션 요소들도 즉시 표시 */
    .trust-badge,
    .report-card-animation,
    .card-hover,
    .running-dot,
    .mileage-dot {
        animation: none !important;
        transition: none !important;
    }
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Typography Enhancement */
.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.text-shadow-sm {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Enhanced Gradient Text */
.text-gradient-enhanced {
    background: linear-gradient(135deg, #FFD93D 0%, #FFA500 50%, #FF6B6B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(255, 217, 61, 0.4));
}

/* Improved CTA Button */
.cta-button {
    background: linear-gradient(135deg, #FFD93D 0%, #FF6B6B 100%);
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(255, 217, 61, 0.3);
}

.cta-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 20px 40px rgba(255, 217, 61, 0.4);
}

/* Hero CTA Button for Login */
.hero-cta-button {
    background: linear-gradient(135deg, #FFD93D 0%, #FF6B6B 100%);
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    color: #1f2937;
    text-decoration: none;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(255, 217, 61, 0.3);
    border: 0;
    cursor: pointer;
}

.hero-cta-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 20px 40px rgba(255, 217, 61, 0.4);
    color: #1f2937;
    text-decoration: none;
}

.hero-cta-text {
    margin-right: 8px;
}

/* Login CTA Highlight Animation for Non-Authenticated Users */
@keyframes login-cta-glow {
    0%, 100% {
        filter: drop-shadow(0 10px 20px rgba(255, 235, 59, 0.5));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 10px 40px rgba(255, 235, 59, 0.8))
                drop-shadow(0 0 50px rgba(255, 255, 255, 0.9))
                drop-shadow(0 0 80px rgba(255, 245, 157, 0.6));
        transform: scale(1.08);
    }
}

.highlight-login-cta {
    animation: login-cta-glow 1s ease-in-out 3;
    position: relative;
    z-index: 10;
    display: inline-block; /* filter가 제대로 작동하도록 */
}

/* Trust Badge Hover */
.trust-badge:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Enhanced Glass Morphism - Optimized */
.glass-enhanced {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    will-change: transform;
    transform: translateZ(0); /* GPU acceleration */
}

/* Reduce blur on mobile for better performance */
@media (max-width: 768px) {
    .glass-morphism,
    .glass-enhanced,
    .nav-scrolled,
    .nav-transparent {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Running Steps Animation - 한 걸음씩 쌓이는 마일리지 */
@keyframes running-step {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.5);
        opacity: 0;
    }
    5% {
        transform: translateY(90vh) translateX(5px) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: translateY(50vh) translateX(-5px) scale(1);
        opacity: 0.8;
    }
    95% {
        transform: translateY(10vh) translateX(5px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) translateX(0) scale(1.5);
        opacity: 0;
    }
}

@keyframes runner-path {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg) scale(0.3);
        opacity: 0;
    }
    10% {
        transform: translateY(80vh) translateX(-10px) rotate(45deg) scale(0.6);
        opacity: 0.4;
    }
    50% {
        transform: translateY(50vh) translateX(10px) rotate(180deg) scale(1);
        opacity: 0.7;
    }
    90% {
        transform: translateY(20vh) translateX(-10px) rotate(315deg) scale(1.1);
        opacity: 0.9;
    }
    100% {
        transform: translateY(-50px) translateX(0) rotate(360deg) scale(1.3);
        opacity: 0;
    }
}

/* Gradient Orb Slow Movement */
@keyframes orb-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(40px, 10px) scale(1.05);
    }
}

.running-dot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 40%, transparent 70%);
    box-shadow: 0 0 20px rgba(255,255,255,0.4), inset 0 0 10px rgba(255,255,255,0.3);
}

.mileage-dot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,217,61,0.9) 0%, rgba(255,217,61,0.5) 50%, transparent 70%);
    box-shadow: 0 0 15px rgba(255,217,61,0.6);
}

/* Step Indicator Styles */
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.step-indicator .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.step-indicator.active .step-number {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.1);
}

.step-indicator.completed .step-number {
    background: #10b981;
    color: white;
}

.step-indicator .step-label {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.step-indicator.active .step-label {
    color: #764ba2;
    font-weight: 600;
}

.step-line {
    width: 60px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 10px;
    margin-top: -20px;
    transition: all 0.3s ease;
}

.step-line.completed {
    background: #10b981;
}

/* Form Field Hover Effects */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    accent-color: #764ba2;
}

/* Mobile Tab Cards Styling */
.tab-card {
    transition: all 0.3s ease;
}

.tab-card:hover {
    transform: translateX(4px);
}

.tab-card.active {
    background-color: rgb(243 232 255);
    border-color: rgb(147 51 234);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .step-indicator .step-label {
        font-size: 10px;
    }
    
    .step-line {
        width: 40px;
    }
    
    /* Remove hover transform on mobile for better UX */
    .tab-card:hover {
        transform: none;
    }
}

/* Modal Animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#successModal:not(.hidden) > div,
#paymentModal:not(.hidden) > div {
    animation: modalFadeIn 0.3s ease-out;
}

/* Enhanced Navigation Styles - Optimized for Performance */
.nav-scrolled {
    background: linear-gradient(135deg, rgba(103, 78, 167, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    will-change: transform;
    transform: translateZ(0); /* GPU acceleration */
}

.nav-transparent {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    will-change: transform;
    transform: translateZ(0); /* GPU acceleration */
}

/* Glassmorphism mobile menu styles */
.glass-menu {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.menu-item-glass {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.menu-item-glass:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 255, 0.7) 100%);
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: 0 8px 32px 0 rgba(167, 139, 250, 0.15);
}

/* Mobile menu animation */
.mobile-menu-slide {
    animation: slideDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile menu styles */
#mobileMenu:not(.hidden) {
    display: block;
}

/* Smooth transitions for menu items */
#mobileMenu a {
    position: relative;
    overflow: hidden;
}

#mobileMenu .menu-item-glass::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#mobileMenu .menu-item-glass:hover::after {
    width: 300px;
    height: 300px;
}

/* Navigation text visibility enhancement */
.nav-text {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.nav-text:hover {
    color: #FFD93D;
    text-shadow: 0 2px 8px rgba(255, 217, 61, 0.4);
    transform: translateY(-1px);
}

.nav-logo-text {
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    font-weight: 800;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD93D 0%, #FF6B6B 100%);
    z-index: 100;
    transition: width 0.2s ease;
}

/* Scroll Down Arrow Animation */
@keyframes scroll-down {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(10px);
        opacity: 0.5;
    }
}

.scroll-indicator {
    animation: scroll-down 2s ease-in-out infinite;
}

/* Accessibility: Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .float-animation,
    .gentle-pulse,
    .stagger-animation,
    .scroll-indicator {
        animation: none !important;
    }
}

/* Performance: Pause animations when not in viewport */
.animation-paused {
    animation-play-state: paused !important;
}

/* Form Validation Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7),
                    0 1px 3px 0 rgba(0, 0, 0, 0.1),
                    0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0),
                    0 0 20px rgba(239, 68, 68, 0.3),
                    0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0),
                    0 1px 3px 0 rgba(0, 0, 0, 0.1),
                    0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }
}

.shake-error {
    animation: shake 0.4s ease-in-out;
}

.glow-error {
    animation: glow-pulse 1.5s infinite;
    border-color: #ef4444 !important;
}

.error-field {
    border-color: #ef4444 !important;
    background-color: rgba(254, 242, 242, 0.5) !important;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

@media (max-width: 640px) {
    .toast-container {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }
}

.toast {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    animation: toastSlideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.toast.error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.toast.success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.toast.warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

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

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

.toast.fade-out {
    animation: toastFadeOut 0.3s ease-in forwards;
}

/* Field Helper Text */
.field-helper {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    display: none;
}

.field-helper.show {
    display: block;
    animation: fade-in-up 0.3s ease-out;
}

/* Validation Icon Animation */
.validation-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.validation-icon.show {
    opacity: 1;
}

.validation-icon.error {
    color: #ef4444;
}

.validation-icon.success {
    color: #10b981;
}

/* Tooltip System - Japanese Form Helper */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tooltip-trigger {
    cursor: help;
    transition: all 0.2s ease;
}

.tooltip-trigger:hover {
    transform: scale(1.1);
    color: #764ba2;
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
    white-space: normal;
    word-break: keep-all;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    z-index: 1000;
    max-width: 240px;
    min-width: 200px;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #764ba2;
}

.tooltip-wrapper:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mobile tooltip adjustment */
@media (max-width: 640px) {
    .tooltip-content {
        max-width: 200px;
        min-width: 160px;
        font-size: 10px;
        padding: 8px 14px;
        line-height: 1.4;
    }
}