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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --text-primary: #ffffff;
    --text-secondary: #eeeeee;
    --text-muted: #71717a;
    --accent-primary: #8b5cf6;
    --accent-success: #22c55e;
    --accent-warning: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --gradient-1: #6366f1;
    --gradient-2: #a855f7;
    --gradient-3: #ec4899;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --font: 'Inter', -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Animated Background */
.bg-gradient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(168, 85, 247, 0.1), transparent),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(236, 72, 153, 0.1), transparent);
}

.floating-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--gradient-1);
    top: -10%;
    right: -10%;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--gradient-2);
    bottom: 20%;
    left: -5%;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: var(--gradient-3);
    bottom: -10%;
    right: 20%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* Header */
.header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 2rem 1rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1) rotate(10deg);
    }
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2), var(--gradient-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Hero */
.hero {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2), var(--gradient-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.4);
}

.arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.15s;
}

.cta-button:hover .arrow-icon {
    transform: translateX(4px);
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Calculator */
.calculator {
    position: relative;
    z-index: 1;
}

.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 6px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    width: 16.67%;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    border-radius: var(--radius-full);
    transition: width 0.4s;
}

.progress-text {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.questions-container {
    position: relative;
    min-height: 400px;
}

.question-card {
    display: none;
    opacity: 0;
    animation: fadeIn 0.4s forwards;
}

.question-card.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-header {
    text-align: center;
    margin-bottom: 2rem;
}

.question-number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.question-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.question-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
}

.option-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.option-btn.selected {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.option-emoji {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.option-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.option-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.multi-select-hint {
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-full);
    display: inline-block;
}

.multi-select .option-btn {
    position: relative;
    padding-right: 3rem;
    /* Make room for checkbox */
}

/* Checkbox container */
.multi-select .option-btn::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
}

/* Checked state - Checkmark handled by ::after if we want, or just styling ::before */
.multi-select .option-btn.selected::before {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Checkmark icon */
.multi-select .option-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

.continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 300px;
    margin: 1.5rem auto 0;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.25s;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: absolute;
    bottom: -60px;
    left: 0;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
}

.back-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.back-icon {
    width: 16px;
    height: 16px;
}

/* Loading */
.loading-section {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
    text-align: center;
}

.loading-content {
    max-width: 400px;
    margin: 0 auto;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--gradient-1);
}

.spinner-ring:nth-child(2) {
    inset: 8px;
    border-right-color: var(--gradient-2);
    animation-delay: 0.2s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    inset: 16px;
    border-bottom-color: var(--gradient-3);
    animation-delay: 0.4s;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.loading-steps {
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    transition: all 0.25s;
}

.loading-step.active {
    color: var(--text-primary);
}

.loading-step.done {
    color: var(--accent-success);
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    background: var(--bg-card);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s;
}

.loading-step.done .step-icon {
    opacity: 1;
    transform: scale(1);
    background: var(--accent-success);
    color: white;
}

/* Results */
.results-section {
    position: relative;
    z-index: 1;
    padding-bottom: 4rem;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.results-title {
    font-size: 2rem;
    font-weight: 800;
}

.fee-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.fee-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.2), transparent 70%);
    pointer-events: none;
}

.fee-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.fee-range {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.fee-currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.fee-min,
.fee-max {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fee-separator {
    font-size: 2rem;
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.fee-confidence {
    max-width: 300px;
    margin: 0 auto;
}

.confidence-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.confidence-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-success), #4ade80);
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
}

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

.fee-explanation {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-icon {
    font-size: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.factors-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.factor-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.factor-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.factor-indicator.positive {
    background: var(--accent-success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.factor-indicator.neutral {
    background: var(--accent-warning);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.factor-indicator.negative {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.factor-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tip-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tip-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.script-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.script-content {
    margin-top: 1rem;
}

.script-intro {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.script-text {
    position: relative;
    padding: 1.5rem;
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid var(--accent-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
}

.copy-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.copy-btn.copied {
    color: var(--accent-success);
    border-color: var(--accent-success);
}

.copy-icon {
    width: 16px;
    height: 16px;
}

.next-steps-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    border-radius: 50%;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.25s;
}

.secondary-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.refresh-icon {
    width: 18px;
    height: 18px;
}

.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer .copyright {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.15s;
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.logo:hover .logo-text {
    opacity: 0.85;
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .main-content {
        padding: 1rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .fee-min,
    .fee-max {
        font-size: 2.25rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}