/**
 * ===========================================================================
 * CONTATTI.CSS v2.2 - Stili Form Contatti
 * ===========================================================================
 * @file: css/pages/contatti.css
 * @description: Stili specifici per il form contatti della pagina contatti
 * @author: Altoprofilo Studio
 * @version: 2.2
 * @last-updated: 2025-10-24
 * @dependencies: base.css, components.css v2.3
 * 
 * @changelog:
 * - v2.2 (2025-10-24): Rimosso Dark Mode (causava sfondo scuro su mobile)
 * - v2.1 (2025-10-24): Pulizia file - rimossi stili duplicati in components.css
 * - v2.0 (2025-10-23): Redesign completo per coerenza
 * 
 * @notes:
 * - Contact Cards (.contatto-card) sono in components.css v2.3
 * - Questo file contiene SOLO gli stili del modulo contatto
 * - Dark Mode rimosso - sarà reintegrato in versione futura
 * ===========================================================================
 */

/* ===========================================================================
   SEZIONE MODULO CONTATTO
   =========================================================================== */

.modulo-contatto {
  padding: 4rem 0;
  background: var(--bg-light, #f9fafb);
}

.form-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------------
   Form Header
   --------------------------------------------------------------------------- */

.form-header {
  text-align: center;
  margin-bottom: 3rem;
}

.form-header .form-icon {
  background: var(--primary-color, #036);
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.form-header .form-icon i {
  width: 24px;
  height: 24px;
}

.form-header h2 {
  margin-bottom: 0.5rem;
  color: var(--text-color, #222);
}

.form-header p {
  color: var(--text-muted, #6b7280);
  font-size: 1.125rem;
}

/* ===========================================================================
   CONTACT FORM - Base Styles
   =========================================================================== */

.contact-form {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  padding: 2rem;
}

/* ---------------------------------------------------------------------------
   Form Rows & Groups
   --------------------------------------------------------------------------- */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------------------
   Form Labels & Required Indicator
   --------------------------------------------------------------------------- */

.form-label {
  display: block;
  font-weight: 500;
  color: var(--text-color, #222);
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.required {
  color: #dc2626;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Form Inputs, Selects, Textareas
   --------------------------------------------------------------------------- */

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
  color: var(--text-color, #222);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color, #036);
  box-shadow: 0 0 0 3px rgba(3, 102, 102, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #9ca3af;
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* ---------------------------------------------------------------------------
   Form Help Text
   --------------------------------------------------------------------------- */

.form-help {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
}

.form-help i {
  width: 14px;
  height: 14px;
  color: var(--accent-color, #f59e0b);
}

/* ===========================================================================
   RADIO & CHECKBOX GROUPS
   =========================================================================== */

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.radio-label:hover {
  background-color: #f9fafb;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color, #036);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.radio-label span {
  font-weight: 400;
  color: var(--text-color, #222);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color, #036);
  margin-top: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-item label {
  font-weight: 400;
  color: var(--text-color, #222);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-item a {
  color: var(--primary-color, #036);
  text-decoration: none;
  font-weight: 500;
}

.checkbox-item a:hover {
  text-decoration: underline;
}

/* ===========================================================================
   CHARACTER COUNT
   =========================================================================== */

.character-count {
  text-align: right;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
}

.character-count.warning {
  color: #f59e0b;
}

.character-count.error {
  color: #dc2626;
}

/* ===========================================================================
   FORM ACTIONS (Buttons)
   =========================================================================== */

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.form-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
}

.form-actions .btn i {
  width: 18px;
  height: 18px;
}

/* ===========================================================================
   MESSAGGI DI STATO
   =========================================================================== */

/* --- Error Message per singolo campo --- */
.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
  font-weight: 500;
}

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

/* --- Success Message globale --- */
.success-message {
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: #065f46;
}

.success-message i {
  width: 20px;
  height: 20px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.success-message strong {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.success-message p {
  margin: 0;
}

/* --- Error Message globale --- */
.error-message-global {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: #991b1b;
}

.error-message-global i {
  width: 20px;
  height: 20px;
  color: #dc2626;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.error-message-global strong {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.error-message-global p {
  margin: 0;
}

/* ===========================================================================
   VALIDATION STATES
   =========================================================================== */

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group.has-error .form-label {
  color: #dc2626;
}

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

@media (max-width: 768px) {
  .modulo-contatto {
    padding: 3rem 0;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

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

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .radio-group {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .modulo-contatto {
    padding: 2rem 0;
  }

  .form-header h2 {
    font-size: 1.5rem;
  }

  .form-header p {
    font-size: 1rem;
  }

  .contact-form {
    padding: 1rem;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 0.9375rem;
  }
}

/* ===========================================================================
   PRINT STYLES
   =========================================================================== */

@media print {
  .form-wrapper {
    display: none;
  }
}

/* ===========================================================================
   ACCESSIBILITY
   =========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .form-input,
  .form-select,
  .form-textarea,
  .radio-label {
    transition: none;
  }
}

.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--primary-color, #036);
  outline-offset: 2px;
}

.radio-label:focus-within,
.checkbox-item:focus-within {
  outline: 2px solid var(--primary-color, #036);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===========================================================================
   END OF FILE
   =========================================================================== */