/* Modern Dark Theme - Complete UI/UX Overhaul */

:root {
    /* Dark Mode Color Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #141420;
    --bg-tertiary: #1a1a2e;
    --bg-card: #16162a;
    --bg-hover: #1f1f35;
    
    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;
    
    /* Gradient Colors */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-card: linear-gradient(145deg, #1a1a2e 0%, #16162a 100%);
    
    /* Border & Shadow */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(99, 102, 241, 0.5);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-20px, -20px) rotate(1deg); }
    66% { transform: translate(20px, -10px) rotate(-1deg); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

/* Header Section */
.form-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding: 3rem 0;
}

.form-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 80px rgba(99, 102, 241, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.form-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

/* Language Toggle */
.language-toggle-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    background: #16162a;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.form-switch-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-switch-modern .form-check-input {
    width: 60px;
    height: 30px;
    background: #1a1a2e !important;
    border: 2px solid rgba(148, 163, 184, 0.3) !important;
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-switch-modern .form-check-input:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #6366f1 !important;
}

.form-switch-modern .form-check-input::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.form-switch-modern .form-check-input:checked::after {
    transform: translateX(30px);
}

/* Cards */
.modern-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-hover);
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-card:hover::before {
    opacity: 1;
}

.card-header-modern {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header-modern h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header-modern .icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.card-header-modern p {
    color: var(--text-secondary);
    margin: 0;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: block;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control-modern {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-control-modern:focus {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-control-modern:valid {
    border-color: var(--accent-success);
}

.form-control-modern::placeholder {
    color: var(--text-dim);
}

/* Enhanced Child Selection */
.child-selector-modern {
    background: var(--gradient-card);
    border: 2px solid var(--accent-primary);
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.child-selector-modern::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.selector-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin: 2rem 0;
    position: relative;
    z-index: 1;
}

.btn-selector {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.btn-selector:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
}

.btn-selector:active {
    transform: scale(0.95);
}

.btn-selector:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.count-display-modern {
    background: var(--bg-primary);
    border: 3px solid var(--accent-primary);
    border-radius: 24px;
    padding: 2rem;
    min-width: 180px;
    position: relative;
}

.count-display-modern .number {
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.count-display-modern .label {
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

/* Child Icons Visual */
.child-icons-modern {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.child-icon-item {
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.child-icon-item.active {
    background: var(--gradient-primary);
    border-color: var(--accent-primary);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.child-icon-item i {
    font-size: 1.5rem;
    color: var(--text-dim);
}

.child-icon-item.active i {
    color: white;
}

/* Submit Button */
.btn-submit-modern {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.btn-submit-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-submit-modern:hover::before {
    left: 100%;
}

.btn-submit-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
}

.btn-submit-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Success Page Specific */
.success-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.success-content {
    text-align: center;
    max-width: 600px;
    animation: successFadeIn 0.8s ease-out;
}

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

.success-icon-animated {
    width: 150px;
    height: 150px;
    margin: 0 auto 2rem;
    position: relative;
}

.success-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-success);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: scaleIn 0.5s ease-out;
    box-shadow: 0 0 60px rgba(16, 185, 129, 0.5);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.checkmark {
    width: 60%;
    height: 60%;
    position: relative;
}

.checkmark-stem {
    position: absolute;
    width: 4px;
    height: 35px;
    background: white;
    left: 28px;
    top: 20px;
    transform: rotate(45deg);
    animation: checkmarkStem 0.4s ease-out 0.5s forwards;
    opacity: 0;
}

.checkmark-kick {
    position: absolute;
    width: 20px;
    height: 4px;
    background: white;
    left: 12px;
    top: 36px;
    transform: rotate(-45deg);
    animation: checkmarkKick 0.4s ease-out 0.5s forwards;
    opacity: 0;
}

@keyframes checkmarkStem {
    to {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }
}

@keyframes checkmarkKick {
    to {
        opacity: 1;
        transform: rotate(-45deg) scale(1);
    }
}

/* Timeline Modern */
.timeline-modern {
    margin: 3rem 0;
    position: relative;
}

.timeline-item-modern {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 4rem;
}

.timeline-item-modern::before {
    content: '';
    position: absolute;
    left: 25px;
    top: 50px;
    width: 2px;
    height: calc(100% + 20px);
    background: var(--border-color);
}

.timeline-item-modern:last-child::before {
    display: none;
}

.timeline-icon-modern {
    position: absolute;
    left: 0;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    z-index: 1;
}

.timeline-content-modern {
    flex: 1;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.timeline-content-modern h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.timeline-content-modern p {
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-header h1 {
        font-size: 2.5rem;
    }
    
    .language-toggle-container {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 2rem;
    }
    
    .selector-controls {
        gap: 1.5rem;
    }
    
    .btn-selector {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .count-display-modern {
        min-width: 120px;
        padding: 1.5rem 1rem;
    }
    
    .count-display-modern .number {
        font-size: 3rem;
    }
    
    .modern-card {
        padding: 1.5rem;
    }
    
    .timeline-item-modern {
        padding-left: 3rem;
    }
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Confetti for Success Page */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    position: absolute;
    animation: confetti-fall 3s linear forwards;
}

.confetti:nth-child(odd) {
    background: var(--accent-secondary);
    animation-duration: 2.5s;
}

.confetti:nth-child(3n) {
    background: var(--accent-success);
    animation-duration: 3.5s;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}