/* [WORKFLOW: RESET & ROOT VARIABLES - PREMIUM DARK MODE] */
:root {
    --primary-color: #ffffff;
    --background: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --font-stack: -apple-system, BlinkMacSystemFont, "San Francisco", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-lg: 20px;
    --radius-md: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-stack);
    background-color: transparent;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    display: flex;
    justify-content: center;
    padding: 24px;
}

/* [WORKFLOW: CONTAINER & STAGE] */
.trap-container {
    width: 100%;
    max-width: 540px;
    background: var(--background) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border) !important;
}

.trap-header {
    padding: 32px 32px 16px;
    border-bottom: 1px solid transparent;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background-color: var(--surface);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent);
    transition: width 0.5s ease-in-out;
    box-shadow: 0 0 10px var(--accent);
}

#stepTitle {
    font-size: 26px !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 8px !important;
    color: var(--text-primary) !important;
    background: transparent !important; /* Fixes parent CSS bleeding */
    padding: 0 !important;
}

#stepSubtitle {
    color: var(--text-secondary) !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    background: transparent !important;
}

/* [WORKFLOW: SLIDE-IN MECHANICS] */
.stage {
    position: relative;
    padding: 16px 32px 32px;
    min-height: 420px;
}

.step {
    position: absolute;
    top: 16px;
    left: 32px;
    right: 32px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.step.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: all;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
}

/* [WORKFLOW: UI COMPONENTS] */
.control-group {
    margin-bottom: 32px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    gap: 16px;
}

.control-header label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.hero-number {
    font-size: 34px !important;
    font-weight: 800 !important;
    color: var(--primary-color) !important;
    letter-spacing: -1px !important;
    display: inline-flex;
    align-items: flex-end;
    white-space: nowrap;
}

.hero-number span {
    font-size: 16px !important;
    font-weight: 500 !important;
    color: var(--accent) !important;
}

/* DROPDOWN SELECT UI ELEMENTS */
.label-with-toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.select-pill {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 30px 6px 12px !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path fill="%2394a3b8" d="M0 0l5 6 5-6z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.select-pill:hover {
    border-color: var(--accent) !important;
}

.select-pill:focus {
    outline: none !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

.freq-select {
    font-size: 16px !important;
    margin-left: 8px !important;
    padding: 2px 28px 2px 10px !important;
    margin-bottom: 6px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path fill="%236366f1" d="M0 0l5 6 5-6z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
}
.freq-select:hover { border: none !important; color: var(--accent) !important; }
.freq-select:focus { box-shadow: none !important; }

.hero-number.secondary {
    font-size: 26px !important;
}

/* [WORKFLOW: CUSTOM PREMUM SLIDERS] */
.custom-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    outline: none;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--accent-hover);
}

.custom-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}

/* [WORKFLOW: CREDIT TIER SELECTOR] */
.credit-tier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.tier-btn {
    padding: 14px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    transition: var(--transition);
}

.tier-btn:hover {
    border-color: var(--accent) !important;
    color: var(--text-primary) !important;
}

.tier-btn.active {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}

/* [WORKFLOW: FORMS & INPUTS] */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="email"] {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--background);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Active Error State */
input.error-state {
    border-color: var(--danger);
    background-color: #fef2f2;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

/* [WORKFLOW: BUTTONS] */
.btn-primary {
    display: block;
    width: 100%;
    padding: 18px;
    background-color: var(--accent) !important;
    color: #ffffff !important;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary:hover {
    background-color: var(--accent-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary.disabled, 
.btn-primary:disabled {
    background-color: var(--border);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* [WORKFLOW: GOOGLE PLACES API CSS OVERRIDE] */
.pac-container {
    background-color: var(--background) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-stack) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    margin-top: 4px !important;
}

.pac-item {
    padding: 12px 16px !important;
    cursor: pointer !important;
    font-size: 15px !important;
    color: var(--text-primary) !important;
    border-top: 1px solid var(--border) !important;
}

.pac-item:hover {
    background-color: var(--surface) !important;
}

.pac-logo::after {
    display: none !important; /* Forces minimal view */
}

/* [WORKFLOW: INTERSTITIAL MICRO-ANIMATION] */
.interstitial-container, .success-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 0;
}

.interstitial-container h2, .success-container h2 {
    font-size: 20px;
    margin-top: 24px;
    color: var(--text-primary);
}

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

.spinner.green {
    border-top-color: var(--success);
}

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

/* [WORKFLOW: SUCCESS REWARD ANIMATION] */
.reward-state {
    padding: 20px 0;
}

.reward-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--success);
    margin-top: 24px;
    letter-spacing: -1px;
}

.reward-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.6;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.checkmark_svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--success);
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--success);
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark_circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--success);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark_check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}
@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 30px rgba(22, 163, 74, 0.1); }
}
