/**
 * CF7 Custom Lightweight Anti-Spam - Frontend Styles
 * Version: 4.3.0
 * 
 * Stili per il form Contact Form 7
 * Percorso: /wp-content/plugins/cf7-custom-antispam/assets/css/frontend.css
 */

/* ==========================================
   CONTENITORE PRINCIPALE
   ========================================== */

.cf7-antispam-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ==========================================
   LAYOUT A COLONNE
   ========================================== */

.cf7-antispam-row {
    display: flex;
    gap: 20px;
    margin-bottom: 5px;
}

.cf7-antispam-row .cf7-antispam-col {
    flex: 1;
    min-width: 0; /* Evita overflow */
}

/* ==========================================
   ETICHETTE
   ========================================== */

.cf7-antispam-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cf7-antispam-wrapper label .required {
    color: #d63638;
    margin-left: 2px;
}

/* ==========================================
   CAMPI INPUT
   ========================================== */

.cf7-antispam-wrapper input[type="text"],
.cf7-antispam-wrapper input[type="email"],
.cf7-antispam-wrapper input[type="tel"],
.cf7-antispam-wrapper input[type="url"],
.cf7-antispam-wrapper input[type="number"],
.cf7-antispam-wrapper textarea,
.cf7-antispam-wrapper select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

.cf7-antispam-wrapper input:focus,
.cf7-antispam-wrapper textarea:focus,
.cf7-antispam-wrapper select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.cf7-antispam-wrapper textarea {
    resize: vertical;
    min-height: 120px;
}

.cf7-antispam-wrapper input[type="text"]:disabled,
.cf7-antispam-wrapper input[type="email"]:disabled,
.cf7-antispam-wrapper textarea:disabled {
    background: #f0f0f1;
    cursor: not-allowed;
}

/* ==========================================
   PULSANTE SUBMIT
   ========================================== */

.cf7-antispam-wrapper .wpcf7-submit {
    background: #2271b1;
    color: #fff;
    padding: 12px 35px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    display: inline-block;
    min-width: 150px;
}

.cf7-antispam-wrapper .wpcf7-submit:hover {
    background: #135e96;
}

.cf7-antispam-wrapper .wpcf7-submit:active {
    transform: scale(0.98);
}

.cf7-antispam-wrapper .wpcf7-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   MESSAGGI DI VALIDAZIONE
   ========================================== */

.cf7-antispam-wrapper .wpcf7-not-valid-tip {
    color: #d63638;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}

.cf7-antispam-wrapper .wpcf7-response-output {
    padding: 12px 20px;
    border-radius: 4px;
    margin: 20px 0 0;
    font-size: 14px;
}

.cf7-antispam-wrapper .wpcf7-validation-errors {
    border: 2px solid #d63638;
    background: #fcf0f0;
    color: #d63638;
}

.cf7-antispam-wrapper .wpcf7-mail-sent-ok {
    border: 2px solid #46b450;
    background: #f0fcf4;
    color: #46b450;
}

.cf7-antispam-wrapper .wpcf7-mail-sent-ng {
    border: 2px solid #d63638;
    background: #fcf0f0;
    color: #d63638;
}

.cf7-antispam-wrapper .wpcf7-spam-blocked {
    border: 2px solid #d63638;
    background: #fcf0f0;
    color: #d63638;
}

/* ==========================================
   HONEYPOT - NASCOSTO
   ========================================== */

.cf7-antispam-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
}

.cf7-antispam-honeypot input {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
}

/* ==========================================
   AJAX LOADING
   ========================================== */

.cf7-antispam-wrapper .wpcf7-spinner {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

.cf7-antispam-wrapper .wpcf7-submit.loading {
    position: relative;
    color: transparent !important;
}

.cf7-antispam-wrapper .wpcf7-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cf7-antispam-spin 0.8s linear infinite;
}

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

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .cf7-antispam-row {
        flex-direction: column;
        gap: 0;
    }
    
    .cf7-antispam-wrapper {
        padding: 15px;
    }
    
    .cf7-antispam-wrapper input[type="text"],
    .cf7-antispam-wrapper input[type="email"],
    .cf7-antispam-wrapper input[type="tel"],
    .cf7-antispam-wrapper textarea {
        font-size: 16px; /* Previene zoom su iOS */
    }
    
    .cf7-antispam-wrapper .wpcf7-submit {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cf7-antispam-wrapper {
        padding: 10px;
    }
    
    .cf7-antispam-wrapper label {
        font-size: 13px;
    }
    
    .cf7-antispam-wrapper input[type="text"],
    .cf7-antispam-wrapper input[type="email"],
    .cf7-antispam-wrapper input[type="tel"],
    .cf7-antispam-wrapper textarea {
        padding: 8px 12px;
        font-size: 15px;
    }
    
    .cf7-antispam-wrapper .wpcf7-submit {
        padding: 10px 20px;
        font-size: 15px;
        min-width: 100%;
    }
}

/* ==========================================
   DARK MODE SUPPORT
   ========================================== */

@media (prefers-color-scheme: dark) {
    .cf7-antispam-wrapper label {
        color: #e0e0e0;
    }
    
    .cf7-antispam-wrapper input[type="text"],
    .cf7-antispam-wrapper input[type="email"],
    .cf7-antispam-wrapper input[type="tel"],
    .cf7-antispam-wrapper textarea,
    .cf7-antispam-wrapper select {
        background: #1e1e1e;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .cf7-antispam-wrapper input:focus,
    .cf7-antispam-wrapper textarea:focus,
    .cf7-antispam-wrapper select:focus {
        border-color: #72aee6;
        box-shadow: 0 0 0 2px rgba(114, 174, 230, 0.2);
    }
    
    .cf7-antispam-wrapper .wpcf7-validation-errors {
        background: #2c1a1a;
        border-color: #d63638;
    }
    
    .cf7-antispam-wrapper .wpcf7-mail-sent-ok {
        background: #1a2c1a;
        border-color: #46b450;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.cf7-antispam-hidden {
    display: none !important;
}

.cf7-antispam-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

.cf7-antispam-text-center {
    text-align: center;
}

.cf7-antispam-mt-10 {
    margin-top: 10px;
}

.cf7-antispam-mt-20 {
    margin-top: 20px;
}

.cf7-antispam-mb-10 {
    margin-bottom: 10px;
}

.cf7-antispam-mb-20 {
    margin-bottom: 20px;
}
