/* Base CSS - Layout and Theme Variables */

:root {
    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-index */
    --z-tooltip: 1000;
    --z-modal: 2000;
    --z-theme-toggle: 100;
}

/* Dark Theme Colors (Default) */
[data-theme="dark"] {
    --color-bg-primary: #090617;
    --color-bg-secondary: #1A1628;
    --color-bg-tertiary: #2A2439;
    
    --color-text-primary: #F9F6FF;
    --color-text-secondary: #C4B5FD;
    --color-text-muted: #8B7AA0;
    
    --color-primary: #9146FF;
    --color-primary-hover: #7A2EF3;
    --color-primary-light: rgba(145, 70, 255, 0.1);
    
    --color-success: #10B981;
    --color-error: #EF4444;
    
    --color-border: #433D58;
    --color-border-light: rgba(67, 61, 88, 0.5);
    
    --color-tooltip-bg: #1F2937;
    --color-tooltip-text: #E5E7EB;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(145, 70, 255, 0.3);
}

/* Light Theme Colors */
[data-theme="light"] {
    --color-bg-primary: #F5F3FF;
    --color-bg-secondary: #FFFFFF;
    --color-bg-tertiary: #F9F7FF;
    
    --color-text-primary: #1F1F1F;
    --color-text-secondary: #4B5563;
    --color-text-muted: #cec7de;
    
    --color-primary: #7A2EF3;
    --color-primary-hover: #6B27DC;
    --color-primary-light: rgba(122, 46, 243, 0.1);
    
    --color-success: #059669;
    --color-error: #DC2626;
    
    --color-border: #E5E7EB;
    --color-border-light: rgba(229, 231, 235, 0.5);
    
    --color-tooltip-bg: #374151;
    --color-tooltip-text: #F3F4F6;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(122, 46, 243, 0.2);
}

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

/* Base Styles */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
    padding-bottom: 100px; /* Space for footer */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Steps */
.step {
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.step.active {
    position: relative;
    opacity: 1;
    visibility: visible;
}

.content {
    width: 100%;
}

/* Form instruction */
.form-instruction {
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin-bottom: var(--space-xl);
    text-align: center;
}

/* Form Container */
.form-container {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-light);
}

.form-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.form-subtitle {
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: var(--space-md);
    font-size: 1.25rem;
}

/* Form Elements */
.birthdate-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.form-select {
    width: 100%;
    padding: var(--space-md);
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238B7AA0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    padding-right: var(--space-2xl);
}

.form-select:hover {
    border-color: var(--color-primary);
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-select.valid {
    border-color: var(--color-success);
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.125rem;   
    line-height: normal;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

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

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

.btn-icon {
    transition: transform var(--transition-fast);
}

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

.offer-cta .btn-icon {
    flex-shrink: 0;
    align-self: flex-start;
}

/* Form Actions */
.form-actions {
    position: relative;
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: calc(100% + var(--space-sm));
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-tooltip-bg);
    color: var(--color-tooltip-text);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: var(--z-tooltip);
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-tooltip-bg);
}

.btn:disabled:hover + .tooltip {
    opacity: 1;
}


/* Processing Container */
.processing-container {
    text-align: center;
    padding: var(--space-3xl) 0;
    position: relative;
    min-height: 500px;
}

.processing-icon {
    width: 300px;
    height: 300px;
    margin: 0 auto var(--space-xl);
    position: relative;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 23px solid #7e32f50d;
    border-top-color: #9146ff1f;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

.processing-steps {
    height: 150px;
    /* position: relative; */
    margin: var(--space-xl) 0;
    display: block;
}

.processing-step {
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    width: 100%;
    left: 0;
    top: 50%;
    padding: 0 var(--space-lg);
    color: var(--color-text-primary);
}

.processing-step .step-text {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Animation states handled by JavaScript */

.step-counter {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}


.processing-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.processing-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}

.processing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.processing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.btn-reveal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(100px);
    opacity: 0;
    border: 3px solid var(--color-primary);
    box-shadow: 0 0 30px rgba(145, 70, 255, 0.6),
                0 0 60px rgba(145, 70, 255, 0.4),
                inset 0 0 20px rgba(145, 70, 255, 0.2);
    animation: slideUpFadeIn 0.8s ease-out forwards,
               pulseGlow 2s ease-in-out infinite;
    animation-delay: 0s, 0.8s;
    z-index: 10;
}

@keyframes slideUpFadeIn {
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(145, 70, 255, 0.6),
                    0 0 60px rgba(145, 70, 255, 0.4),
                    inset 0 0 20px rgba(145, 70, 255, 0.2);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(145, 70, 255, 0.8),
                    0 0 80px rgba(145, 70, 255, 0.6),
                    inset 0 0 30px rgba(145, 70, 255, 0.3);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Results */
.results-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.life-path-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-primary-light);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-full);
    padding: var(--space-md) var(--space-xl);
    margin-bottom: var(--space-lg);
}

.life-path-badge span:first-child {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.life-path-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.results-headline {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.results-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.125rem;
}

.results-content {
    margin-bottom: var(--space-3xl);
}

/* Results Grid */
.results-grid {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

@media (min-width: 480px) {
    .results-grid {
        /* grid-template-columns: 1fr 1fr; */
    }
}

.result-block {
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.results-grid .result-block {
    margin-bottom: 0;
}

.result-block h3 {
    font-size: 1.25rem;
    /* font-weight: 600; */
    margin-bottom: var(--space-md);
}

.result-block p {
    line-height: 1.8;
    font-weight: 500;
}

/* Highlight class for text emphasis */
.highlight {
    background-color: #fff59d;
    padding: 4px 4px;
    border-radius: 3px;
    font-weight: 500;
}
[data-theme="dark"] .highlight {
    background-color: #ffe50047;
}

/* Offers Section */
.offers-section {
    margin-top: var(--space-3xl);
}

.offers-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--space-xl);
}

.offers-grid {
    display: grid;
    gap: var(--space-2xl);
}

.offer-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.offer-card {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl) var(--space-xl) var(--space-xl);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

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

@media (max-width: 480px) {
    .offer-card {
        padding: var(--space-xl);
    }
}

.offer-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-primary);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 0 var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.offer-match {
    display: inline-block;
    background: var(--color-success);
    /* color: white; */
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.offer-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}


.offer-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.offer-cta {
    width: 100%;
    margin-top: var(--space-lg);
    padding: var(--space-md) var(--space-xl);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    box-shadow: 0px 4px 10px #00000063;
}

.offer-cta-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
    flex: 1;
}

.offer-cta-text {
    font-weight: 600;
}

.offer-promotion {
    background: antiquewhite;
    color: var(--color-primary);
    padding: 0.3rem var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    font-weight: 800;
    margin-top: var(--space-sm);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 48px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: var(--z-theme-toggle);
}

.theme-toggle:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-primary);
}

.theme-icon {
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

[data-theme="dark"] .theme-icon--light {
    display: none;
}

[data-theme="light"] .theme-icon--dark {
    display: none;
}

/* Footer */
.footer {
    padding: var(--space-md) var(--space-lg);
    text-align: center;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.footer-link {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

/* Countdown Banner */
.countdown-banner {
    position: fixed;
    top: -60px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    padding: var(--space-sm) var(--space-md);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: top 0.5s ease-out;
}

.countdown-banner.show {
    top: 0;
}

.countdown-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.countdown-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.countdown-timer {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

@keyframes flashRed {
    0%, 100% {
        color: white;
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    }
    50% {
        color: #ff6b6b;
        text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    }
}

/* Sticky CTA styles */
.sticky-cta {
    box-shadow: 0 0 30px rgba(145, 70, 255, 0.6),
                0 0 60px rgba(145, 70, 255, 0.4),
                0 -2px 20px rgba(0, 0, 0, 0.3),
                inset 0 0 20px rgba(145, 70, 255, 0.2);
    animation: stickyPulse 2s ease-in-out infinite;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    border: 2px solid rgba(145, 70, 255, 0.8);
}

@keyframes stickyPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 30px rgba(145, 70, 255, 0.6),
                    0 0 60px rgba(145, 70, 255, 0.4),
                    0 -2px 20px rgba(0, 0, 0, 0.3),
                    inset 0 0 20px rgba(145, 70, 255, 0.2);
    }
    50% {
        transform: translateX(-50%) scale(1.02);
        box-shadow: 0 0 40px rgba(145, 70, 255, 0.8),
                    0 0 80px rgba(145, 70, 255, 0.6),
                    0 -2px 25px rgba(0, 0, 0, 0.4),
                    inset 0 0 30px rgba(145, 70, 255, 0.3);
    }
}

.sticky-cta:hover {
    animation-play-state: paused;
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 0 50px rgba(145, 70, 255, 1),
                0 0 100px rgba(145, 70, 255, 0.8),
                0 -2px 30px rgba(0, 0, 0, 0.5),
                inset 0 0 40px rgba(145, 70, 255, 0.4);
}

.sticky-cta .offer-promotion {
    animation: promotionGlow 1.5s ease-in-out infinite alternate;
}

@keyframes promotionGlow {
    from {
        background: #faebd7;
        box-shadow: 0 0 5px rgba(145, 70, 255, 0.3);
    }
    to {
        background: #fff8dc;
        box-shadow: 0 0 10px rgba(145, 70, 255, 0.5);
    }
}

@keyframes stickyBounceIn {
    0% {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    60% {
        transform: translateX(-50%) translateY(-10px);
        opacity: 1;
    }
    80% {
        transform: translateX(-50%) translateY(5px);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: var(--space-md);
    }
    
    .form-container {
        padding: var(--space-xl);
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .form-row {
        gap: var(--space-md);
        grid-template-columns: 1fr;
    }
    
    .form-group {
        display: grid;
        grid-template-columns: 80px 1fr;
        align-items: center;
        gap: var(--space-lg);
    }
    
    .form-group label {
        margin-bottom: 0;
        white-space: nowrap;
        text-align: right;
    }
    
    .form-select {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }
    
    .btn-primary {
        font-size: 1.125rem;   
        padding: var(--space-md) var(--space-lg);
    }
    
    .slider-item {
        padding-right: var(--space-md);
    }
    
    .btn-reveal {
        padding: var(--space-md) var(--space-lg);
        bottom: 150px;
    }
    
    .offer-cta {
        padding: var(--space-sm) var(--space-md);
    }
    
    .offer-promotion {
        font-size: 0.75rem;
        padding: 2px var(--space-sm);
    }
    
    .processing-step .step-text {
        font-size: 1.2rem;
        line-height: .9;
        font-weight: 600;
    }
    
    .step-counter {
        display: none;
    }
    
    .countdown-banner {
        padding: var(--space-xs) var(--space-sm);
    }
    
    .countdown-text {
        font-size: 0.75rem;
    }
    
    .countdown-timer {
        font-size: 1.25rem;
    }
}