:root {
    --modal-overlay: rgba(1, 18, 32, 0.85);
    --card-shadow: 0 40px 100px rgba(0, 0, 0, 0.25);
    --input-focus: #003566;
    --error-color: #ef4444;
    --success-state-color: #22c55e;
}

.form-page {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('assets/hero_bg.png');
    background-size: cover;
    background-position: center;
    filter: blur(8px);
    z-index: -1;
}

.form-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.close-form {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2.5rem;
    color: var(--white);
    opacity: 0.6;
    transition: var(--transition-smooth);
}

.close-form:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.form-card {
    background: var(--white);
    border-radius: 32px;
    padding: 50px;
    box-shadow: var(--card-shadow);
    min-height: 500px;
    position: relative;
    transition: var(--transition-smooth);
}

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

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-bar-bg {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-red));
    transition: width 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Typography */
.form-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-blue);
    margin-bottom: 10px;
}

.form-subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--brand-dark);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(0, 53, 102, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Radio Pill Group */
.radio-pill-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-pill-group input {
    display: none;
}

.radio-pill-group span {
    display: inline-block;
    padding: 12px 24px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.radio-pill-group input:checked + span {
    background: var(--brand-blue);
    color: var(--white);
}

/* Housing Visual Selectors */
.housing-type-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.housing-item input {
    display: none;
}

.housing-card {
    padding: 24px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: #fff;
}

.housing-card .icon {
    font-size: 2rem;
}

.housing-card span:last-child {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.housing-item input:checked + .housing-card {
    background: rgba(0, 53, 102, 0.03);
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 53, 102, 0.1);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

input:checked + .slider {
    background-color: var(--brand-red);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 30px 0;
}

.toggle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.toggle-item span {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Map & Price */
.map-container {
    height: 250px;
    background: #f1f5f9;
    border-radius: 16px;
    margin: 30px 0;
    z-index: 1;
}

.price-estimate {
    background: rgba(230, 57, 70, 0.05);
    border: 2px dashed rgba(230, 57, 70, 0.2);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
}

.price-estimate strong {
    font-size: 1.8rem;
    color: var(--brand-red);
    display: block;
    margin: 5px 0;
}

.small {
    font-size: 0.8rem;
    opacity: 0.7;
}

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

.option-check input { display: none; }

.check-box {
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.option-check input:checked + .check-box {
    background: rgba(230, 57, 70, 0.03);
    border-color: var(--brand-red);
    color: var(--brand-red);
}

/* Final Steps / Navigation */
.step-content {
    display: none;
    animation: slideIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.step-content.active {
    display: block;
}

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

.form-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

/* Loading State */
.loading-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 32px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(0, 53, 102, 0.1);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 24px;
}

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

/* Success Screen */
.success-screen {
    text-align: center;
    padding: 40px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-state-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 30px;
    animation: pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.countdown-box {
    margin: 40px 0;
    padding: 30px;
    background: #f1f5f9;
    border-radius: 20px;
}

.countdown-box span {
    font-size: 3rem;
    font-weight: 800;
    color: var(--brand-blue);
    font-variant-numeric: tabular-nums;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Utilities */
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

/* Responsive */
@media (max-width: 768px) {
    .form-card { padding: 30px; }
    .housing-type-grid { grid-template-columns: repeat(3, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .toggles-grid { grid-template-columns: 1fr; gap: 15px; }
    .options-grid { grid-template-columns: 1fr; }
    .success-actions { flex-direction: column; }
}
