/* =========================================
   CONTATTACI — APPLE WIDGET STYLE
   ========================================= */

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.contact-page-wrapper {
    max-width: 1200px;
    margin: 140px auto 80px;
    padding: 0 20px;
}

.split-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 60px;
}

.text-side {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 20px;
}

.page-title {
    font-size: 3rem;
    color: var(--color-text-dark);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.highlight {
    color: var(--color-primary);
}

.intro-text {
    font-size: 1.1rem;
    color: var(--color-text-gray);
    line-height: 1.6;
    margin-bottom: 40px;
}

.quick-actions {
    display: flex;
    gap: 15px;
}

.square-btn {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 20px 10px;
    text-align: center;
    text-decoration: none;
    color: var(--color-text-dark);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.square-btn i {
    font-size: 1.8rem;
    color: var(--color-primary);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.square-btn span {
    font-weight: 600;
    font-size: 0.85rem;
}

.square-btn:hover {
    transform: scale(1.04);
    background: var(--card-bg-hover);
    box-shadow: var(--shadow-md);
}

.square-btn:hover i {
    transform: scale(1.2);
}

.square-btn:active {
    transform: scale(0.96);
}

.form-side {
    flex: 1.2;
    min-width: 260px;
}

.form-card {
    background: var(--card-bg);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.form-header h2 {
    font-size: 1.8rem;
    color: var(--color-text-dark);
    font-weight: 700;
    margin-bottom: 8px;
}

.form-header p {
    color: var(--color-text-gray);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 15px;
}

.form-group label {
    color: var(--color-text-dark);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    background: var(--settings-bg);
    border: 1px solid var(--card-border);
    /* Bordo aggiunto qui */
    border-radius: 16px;
    padding: 16px;
    font-size: 1rem;
    color: var(--color-text-dark);
    transition: all 0.3s ease;
    font-family: inherit;
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-gray);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    background: var(--card-bg-hover);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-glow);
}

.privacy-group {
    background: var(--settings-bg);
    padding: 15px;
    border-radius: 16px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 25px;
}

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

.privacy-notice {
    font-size: 0.85rem;
    color: var(--color-text-gray);
    line-height: 1.5;
}

.privacy-link {
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.map-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--card-border);
    margin-bottom: 40px;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.map-header {
    text-align: center;
    margin-bottom: 20px;
}

.map-header h3 {
    font-size: 1.5rem;
    color: var(--color-text-dark);
    font-weight: 700;
}

.map-header p {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.map-frame-container {
    height: 400px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    background: var(--color-bg);
}

#map-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 20px;
}

#map-placeholder h4 {
    color: var(--color-text-dark);
    margin-bottom: 10px;
    margin-top: 15px;
    font-weight: 700;
}

#map-placeholder p {
    color: var(--color-text-gray);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.map-placeholder-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 15px var(--color-primary-glow));
    margin-bottom: 5px;
}

.btn-map-consent {
    padding: 16px 36px;
    background: linear-gradient(135deg, var(--color-primary), #2cbf6d);
    color: #ffffff;
    border-radius: var(--radius-pill);
    border: none;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    box-shadow: var(--shadow-green);
    cursor: pointer;
    transition: var(--transition-base);
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-map-consent:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 38px rgba(31, 157, 85, 0.35);
    background: linear-gradient(135deg, #2cbf6d, var(--color-primary));
}

.btn-map-consent:active {
    transform: translateY(-1px) scale(0.98);
}

.testo-raggiungerci {
    text-align: center;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.testo-raggiungerci h4 {
    font-size: 1.6rem;
    color: var(--color-text-dark);
    margin-bottom: 15px;
    font-weight: 700;
}

.testo-raggiungerci h4 i {
    color: var(--color-primary);
    margin-right: 8px;
}

.testo-raggiungerci p {
    font-size: 1.1rem;
    color: var(--color-text-gray);
    line-height: 1.8;
}

.contact-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content.privacy-modal {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    border-radius: 24px;
    width: 95%;
    max-width: 500px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: scaleUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-wrap: nowrap;
    transform: none;
    max-height: 90vh;
}

.modal-content.privacy-modal h2 {
    font-size: 1.4rem;
    color: var(--color-text-dark);
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--color-text-gray);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.close-modal:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-title-green {
    color: var(--color-primary) !important;
}

.modal-text {
    max-height: 50vh;
    overflow-y: auto;
    font-size: 0.9rem;
    color: var(--color-text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-text-justified {
    text-align: left;
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.reveal-on-scroll {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1), transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: opacity, transform;
}

.reveal-left {
    transform: translateX(-150px);
}

.reveal-right {
    transform: translateX(150px);
}

.reveal-bottom {
    transform: translateY(100px);
}

.reveal-top {
    transform: translateY(-100px);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translate(0, 0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

.delay-6 {
    transition-delay: 0.6s;
}

.delay-7 {
    transition-delay: 0.7s;
}

.delay-8 {
    transition-delay: 0.8s;
}

.delay-9 {
    transition-delay: 0.9s;
}

@media (max-width: 768px) {
    .contact-page-wrapper {
        margin: 100px auto 60px;
    }

    .split-container {
        flex-direction: column;
    }

    .quick-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .square-btn {
        flex: 1 1 140px;
    }

    .form-card {
        padding: 25px 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .page-title {
        font-size: 2.2rem;
        text-align: center;
    }

    .intro-text {
        text-align: center;
    }

    .map-frame-container {
        height: 280px;
    }
}

/* =========================================
   DARK MODE OVERRIDES - CONTATTACI
   ========================================= */
[data-theme="dark"] body {
    background-color: #000000;
}

[data-theme="dark"] .page-title,
[data-theme="dark"] .form-header h2,
[data-theme="dark"] .form-group label,
[data-theme="dark"] .map-header h3,
[data-theme="dark"] .testo-raggiungerci h4,
[data-theme="dark"] .modal-content.privacy-modal h2,
[data-theme="dark"] #map-placeholder h4 {
    color: #f5f5f7;
}

[data-theme="dark"] .intro-text,
[data-theme="dark"] .form-header p,
[data-theme="dark"] .privacy-notice,
[data-theme="dark"] .testo-raggiungerci p,
[data-theme="dark"] .modal-text,
[data-theme="dark"] #map-placeholder p {
    color: #a1a1a6;
}

[data-theme="dark"] .square-btn,
[data-theme="dark"] .form-card,
[data-theme="dark"] .map-card,
[data-theme="dark"] .modal-content.privacy-modal,
[data-theme="dark"] #map-placeholder {
    background: rgba(30, 30, 32, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .square-btn:hover {
    background: #1c1c1e;
}

[data-theme="dark"] .square-btn span {
    color: #f5f5f7;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .privacy-group,
[data-theme="dark"] .map-frame-container {
    background: #1c1c1e;
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.15);
    /* Bordo più visibile per la dark mode qui */
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
    background: #2c2c2e;
    border-color: #16a34a;
}