/* css/style.css - Sistema di Valutazione Immobiliare */

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

:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --secondary: #6366F1;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #EFF6FF 0%, #E0E7FF 100%);
    min-height: 100vh;
    color: var(--gray-800);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==================== HEADER ==================== */
.header {
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo .icon {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.25rem;
    color: var(--gray-800);
    font-weight: 700;
}

.logo p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--warning);
    font-weight: bold;
    font-size: 1.125rem;
}

.progress-text {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* ==================== PROGRESS BAR ==================== */
.progress-container {
    background: white;
    padding: 0 0 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ==================== MAIN CONTENT ==================== */
.main {
    padding: 2rem 0;
}

.quiz-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* ==================== STEP HEADER ==================== */
.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-icon {
    width: 48px;
    height: 48px;
    background: #DBEAFE;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.step-title h2 {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.step-title p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* ==================== INFO BOX ==================== */
.info-box {
    background: #DBEAFE;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.info-box p {
    color: #1E40AF;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==================== INPUT STYLES ==================== */
.input-group {
    margin-bottom: 2rem;
}

.form-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #BFDBFE;
    border-radius: 0.75rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    background: white;
}

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

/* ==================== RADIO & CHECKBOX GROUPS ==================== */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: #93C5FD;
    background: var(--gray-50);
}

.radio-option input,
.checkbox-option input {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.radio-option label,
.checkbox-option label {
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
    flex: 1;
}

/* ==================== TEXT INPUT ==================== */
.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #BFDBFE;
    border-radius: 0.75rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
}

/* ==================== CONTACT FORM ==================== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* ==================== NAVIGATION BUTTONS ==================== */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

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

/* ==================== INFO BANNER ==================== */
.info-banner {
    background: linear-gradient(135deg, #FEF3C7 0%, #FEE2E2 100%);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-top: 1.5rem;
}

.info-banner h3 {
    color: #92400E;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.info-banner p {
    color: #B45309;
    line-height: 1.6;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    color: white;
    margin-top: 1rem;
    font-size: 1.125rem;
}

/* ==================== RESULTS PAGE STYLES ==================== */
.results-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .results-container {
        grid-template-columns: 2fr 1fr;
    }
}

.result-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

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

.result-header .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-header h1 {
    font-size: 2.5rem;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.result-header p {
    color: var(--gray-600);
}

.price-display {
    text-align: center;
    margin: 2rem 0;
}

.price-main {
    font-size: 3rem;
    font-weight: bold;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.price-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.price-box {
    text-align: center;
    padding: 1rem;
    border-radius: 0.75rem;
}

.price-box-min {
    background: #DBEAFE;
}

.price-box-max {
    background: #D1FAE5;
}

.price-box .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gray-800);
}

.price-box .label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.success-box {
    background: #D1FAE5;
    padding: 1.5rem;
    border-radius: 1rem;
    margin: 2rem 0;
}

.success-box h3 {
    color: #065F46;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.success-box p {
    color: #047857;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

@media (min-width: 640px) {
    .action-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

/* ==================== GOOGLE MAPS AUTOCOMPLETE ==================== */
.address-input-container {
    position: relative;
}

.address-input-container .form-input {
    padding-left: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 18px;
}

.address-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stili per il dropdown di Google Places Autocomplete */
.pac-container {
    border-radius: 0.75rem;
    border: 2px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 10000;
}

.pac-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.pac-item:hover {
    background: #EFF6FF;
}

.pac-item-selected {
    background: #DBEAFE;
}

.pac-icon {
    margin-right: 0.75rem;
}

.pac-item-query {
    font-size: 1rem;
    color: var(--gray-800);
    font-weight: 500;
}

.pac-matched {
    font-weight: 700;
    color: var(--primary);
}

/* Nascondi il "Powered by Google" */
.pac-container:after {
    background-image: none !important;
    height: 0px;
    padding: 0;
    margin: 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .quiz-card {
        padding: 1.5rem;
    }
    
    .step-title h2 {
        font-size: 1.25rem;
    }
    
    .result-header h1 {
        font-size: 2rem;
    }
    
    .price-main {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}