/* ============================================
   CONTATTI.CSS — Stili custom per la pagina Contatti
   Form inputs dark mode, focus states, loading spinner,
   success/error feedback.
   ============================================ */

/* Form input base */
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text);
  font-family: var(--font-satoshi);
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.5;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--color-muted);
  opacity: 0.6;
}

.form-input:hover {
  border-color: #3a3a3a;
  background-color: var(--color-surface-hover);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-muted),
              0 0 20px rgba(200, 168, 78, 0.08);
  background-color: var(--color-surface-hover);
}

/* Textarea specifics */
textarea.form-input {
  resize: vertical;
  min-height: 140px;
}

/* Error state */
.form-input.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input.is-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25),
              0 0 20px rgba(239, 68, 68, 0.08);
}

/* Error message text */
.form-error {
  color: #ef4444;
  font-size: 0.8125rem;
  font-weight: 400;
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Label */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.form-label-required {
  color: var(--color-accent);
  margin-left: 0.125rem;
}

/* Custom checkbox */
.form-checkbox {
  width: 1.125rem;
  height: 1.125rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.form-checkbox:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.form-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid var(--color-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-muted);
}

.form-checkbox.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-bg);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Success / Error status messages */
.form-status {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.5;
}

.form-status-success {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.form-status-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.form-status-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.0625rem;
}

/* Contact info card — transitions solo dopo animazione GSAP */
.contact-card {
  padding: 1.5rem;
  border-radius: 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
}

.contact-card.animated {
  transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-card.animated:hover {
  border-color: var(--color-accent-muted);
  transform: translateY(-2px);
}

.contact-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--color-accent-muted);
  color: var(--color-accent);
  border-radius: 0.5rem;
  flex-shrink: 0;
}

/* Google Maps iframe container */
.map-container {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.map-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(1) invert(0.92) contrast(0.83) brightness(0.7);
}

/* Social link hover */
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: var(--color-accent-muted);
  transform: translateY(-2px);
}

/* Submit button disabled state */
.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .contact-card.animated {
    transition: none;
  }
  .contact-card.animated:hover {
    transform: none;
  }
  .social-link {
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  }
  .social-link:hover {
    transform: none;
  }
  .spinner {
    animation: spin 1.2s linear infinite;
  }
}
