:root {
    --primary: #0ea5e9;
    /* Sky Blue */
    --primary-hover: #0284c7;
    --primary-light: #e0f2fe;
    --secondary: #6366f1;
    /* Indigo */
    --accent: #14b8a6;
    /* Teal */

    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    /* Darkened for better contrast */

    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --success: #10b981;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-card: 0 12px 40px -12px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;

    /* Modern mesh-like background hint */
    background-image:
        radial-gradient(at 0% 0%, hsla(199, 89%, 90%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(230, 80%, 93%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(173, 80%, 92%, 1) 0px, transparent 50%);
    background-attachment: fixed;
}

.finder-wrapper {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 24px;
    width: 100%;
}

/* Header */
.finder-header {
    text-align: center;
    margin-bottom: 48px;
}

.finder-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.finder-header p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Main Card Container */
.finder-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

@media(min-width: 768px) {
    .finder-card {
        padding: 40px;
    }
}

/* Progress Bar */
.progress-container {
    margin-bottom: 40px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.progress-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Steps */
.step-container {
    position: relative;
    flex-grow: 1;
}

.step {
    display: none;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    opacity: 0;
}

.step.active {
    display: block;
    position: relative;
    opacity: 1;
    animation: slideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

.step.fade-out {
    animation: fadeOut 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.step-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    line-height: 1.3;
}

.step-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Info Accordion */
.info-accordion {
    margin-bottom: 32px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-accordion[open] {
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.info-accordion summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    user-select: none;
    transition: color 0.2s;
}

.info-accordion summary::-webkit-details-marker {
    display: none; /* Hide default arrow in Safari */
}

.info-accordion summary svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.info-accordion summary:hover {
    color: var(--primary);
}

.info-content {
    padding: 0 20px 20px 20px;
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid transparent;
}
.info-accordion[open] .info-content {
    border-top-color: var(--border-color);
    padding-top: 16px;
    animation: fadeInAccordion 0.4s ease-in-out;
}

@keyframes fadeInAccordion {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media(min-width: 640px) {
    .options-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Specific grids */
.grid-2,
.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Option Cards */
.option-card {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.option-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.option-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

.option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--text-muted);
    transition: all 0.25s;
}

.option-card:hover .option-icon {
    background: #e2e8f0;
    color: var(--primary);
}

.option-card.selected .option-icon {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.option-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.option-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Selection Indicator */
.selection-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.selection-indicator svg {
    width: 14px;
    height: 14px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.option-card.selected .selection-indicator {
    background: var(--primary);
    border-color: var(--primary);
}

.option-card.selected .selection-indicator svg {
    opacity: 1;
    transform: scale(1);
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    gap: 8px;
}

.btn-prev {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.btn-prev:hover {
    color: var(--text-main);
    background: #f1f5f9;
}

.btn-prev.hidden {
    visibility: hidden;
}

.btn-next {
    background: var(--text-main);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-md);
}

.btn-next:hover:not(:disabled) {
    background: #000;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--text-muted);
}

/* Result Step */
.result-container {
    text-align: center;
    padding: 20px 0;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

.result-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 0 0 10px rgba(20, 184, 166, 0.1);
}

.result-icon-wrapper svg {
    color: var(--accent);
    width: 40px;
    height: 40px;
}

.result-title {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-package {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 40px auto;
    line-height: 1.7;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 18px 40px;
    font-size: 1.1rem;
    border-radius: 999px;
    border: none;
    box-shadow: 0 10px 20px -10px var(--secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px var(--secondary);
}

.btn-primary svg {
    transition: transform 0.3s;
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 2px solid var(--border-color);
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

@media(min-width: 640px) {
    .result-actions {
        flex-direction: row;
    }
}

/* Live Estimate Tracking */
.current-estimate-container {
    background: #f8fafc;
    border: 1px dashed var(--border-hover);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInAccordion 0.4s ease-in-out;
}

.estimate-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.estimate-value {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    text-transform: uppercase;
}

.live-badge {
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

/* --- ROULETTE STYLES --- */
.roulette-container {
    margin: 40px auto 20px auto;
    padding: 30px;
    background: #f8fafc;
    border-radius: 20px;
    border: 2px dashed var(--border-hover);
    max-width: 400px;
    text-align: center;
    animation: fadeInAccordion 1s ease-in-out;
}

.roulette-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 24px;
}

.wheel-box {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 24px auto;
}

.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: #ef4444; /* Red pointer */
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 20;
    filter: drop-shadow(0 4px 2px rgba(0,0,0,0.2));
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    /* 4 Colors for a nice segmented look */
    background: conic-gradient(
        var(--primary) 0 90deg, 
        #f59e0b 90deg 180deg, 
        var(--secondary) 180deg 270deg, 
        #10b981 270deg 360deg
    );
    border: 6px solid #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    /* initial rotation */
    transform: rotate(0deg);
}

.wheel::after {
    content: "★";
    color: var(--primary);
    font-size: 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
}

/* Winning Box */
.won-code-container {
    margin: 30px auto;
    padding: 30px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 20px;
    border: 2px solid #22c55e;
    max-width: 450px;
    text-align: center;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.won-code-container h3 {
    color: #166534;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.code-box {
    display: inline-block;
    padding: 12px 24px;
    background: #fff;
    border: 2px dashed #22c55e;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 900;
    color: #15803d;
    margin: 16px 0;
    letter-spacing: 2px;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.code-box:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.3);
}

.code-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.code-box {
    margin: 0 !important; /* Override previous margin */
}

.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #e6f6ec;
    color: #15803d;
    border: 2px dashed #22c55e;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-copy:hover {
    background: #dcfce7;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.2);
}

.code-desc {
    font-size: 1.05rem;
    color: #166534;
    margin-bottom: 12px;
    font-weight: 600;
}

.small-hint {
    font-size: 0.85rem;
    color: #15803d;
    opacity: 0.8;
}