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

:root {
    --primary-color: #003C71;
    --primary-dark: #002a52;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --error: #dc3545;
    --success: #28a745;
    --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-light);
}

/* Banner */
.banner {
    max-width: 800px;
    margin: 40px auto 0;
    padding: 0 24px;
}

.banner img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Main Content */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
}

.main-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

.description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
    text-align: center;
}

/* Form Section */
.form-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.form-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #005a9e 100%);
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 60, 113, 0.3);
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.form-container {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 8px;
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--white);
    transition: border-color 0.2s ease;
}

#ac-wrap {
    width: 100%;
    color-scheme: light;
}

#ac-wrap gmp-place-autocomplete {
    width: 100% !important;
    display: block !important;
    background: #ffffff !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    color-scheme: light !important;
    --gmpac-color-surface: #ffffff;
    --gmpac-color-on-surface: #333333;
    --gmpac-color-on-primary: #333333;
    --gmpac-color-on-surface-variant: #666666;
    --gmpac-color-outline: transparent;
    --gmpac-color-surface-container-highest: #ffffff;
    --gmpac-color-on-surface-container-highest: #333333;
    --gmpac-color-primary: var(--primary-color);
}

#ac-wrap gmp-place-autocomplete:focus-within {
    border-color: var(--primary-dark) !important;
}

/* Dropdown suggerimenti - forza bianco */
gmp-place-autocomplete-overlay,
.pac-container {
    background: #ffffff !important;
    color: #333333 !important;
    color-scheme: light !important;
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    z-index: 10000 !important;
}

gmp-place-autocomplete-overlay .suggestion,
gmp-place-autocomplete-overlay [role="option"] {
    background: #ffffff !important;
    color: #333333 !important;
}

gmp-place-autocomplete-overlay .suggestion:hover,
gmp-place-autocomplete-overlay [role="option"]:hover {
    background: #f8f9fa !important;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-dark);
}

.form-group input.error {
    border-color: var(--error);
}

.form-group input.success {
    border-color: var(--success);
    background-image: var(--icon-check);
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px 20px;
    padding-right: 42px;
}

.error-message {
    font-size: 0.85rem;
    color: #ff6b6b;
    margin-top: 6px;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Phone input group */
.phone-input-group {
    display: flex;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.phone-input-group:focus-within {
    border-color: var(--primary-dark);
}

.phone-input-group.error {
    border-color: var(--error);
}

.phone-input-group.success {
    border-color: var(--success);
}

.phone-input-group.success input {
    background-image: var(--icon-check);
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px 20px;
    padding-right: 42px;
}

.phone-input-group select {
    width: 130px;
    flex-shrink: 0;
    border: none;
    border-right: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 14px 12px;
    background: var(--bg-light);
    font-family: inherit;
    font-size: 1rem;
}

.phone-input-group select:focus {
    outline: none;
}

.phone-input-group input {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 14px 16px;
}

.phone-input-group input:focus {
    outline: none;
}

/* Optional label */
.optional-label {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.8rem;
}

.comune-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    line-height: 1.6;
}

.comune-info p {
    margin: 0;
}

.comune-info strong {
    color: var(--white);
}

.field-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 8px;
    line-height: 1.4;
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: var(--white);
    font-size: 0.9rem;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--white);
}

.checkbox-group.error .checkbox-label {
    color: #ff6b6b;
}

.checkbox-group.error .checkbox-label input[type="checkbox"] {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
}

.checkbox-label a {
    color: var(--white);
    text-decoration: underline;
}

.checkbox-label a:hover {
    opacity: 0.9;
}

.submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary-color);
    background: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 16px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-note {
    margin-top: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.5;
}

/* Status page (newsletter.subscribe.php) */
.status-card {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.status-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 0 auto;
}

.status-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
}

.status-icon.success {
    background: rgba(40, 167, 69, 0.2);
    border: 3px solid var(--success);
}

.status-icon.error {
    background: rgba(220, 53, 69, 0.2);
    border: 3px solid var(--error);
}

.status-message {
    color: var(--text-color);
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 30px;
}

.back-btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Back to home (aggiorna.php) */
.back-home-wrap {
    text-align: center;
    margin: 30px 0 50px;
}

.back-home-btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-home-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Footer */
footer {
    background: var(--white);
    padding: 40px 24px;
    text-align: center;
    margin-top: 80px;
    border-top: 1px solid #e0e0e0;
}

.footer-logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.footer-info {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.8;
}

.footer-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-info a:hover {
    color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 600px) {
    .banner {
        margin-top: 20px;
        padding: 0 16px;
    }

    .main-content {
        padding: 40px 20px;
    }

    .form-section {
        padding: 0 16px;
    }

    .form-card {
        padding: 35px 24px;
        border-radius: 12px;
    }

    .status-card {
        padding: 35px 24px;
        border-radius: 12px;
    }

    .status-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .status-message {
        font-size: 1rem;
    }
}