/* ============================================
   CONTACT.CSS — Page Contact
   Utilise les variables définies dans base.css
   ============================================ */

/* --- Hero --- */
.contact-hero {
  padding: var(--space-4xl) 0 var(--space-2xl);
}

.contact-hero-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.contact-hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* --- Contact section (form + infos) --- */
.contact-section {
  padding: 0 0 var(--space-4xl);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-3xl);
  align-items: start;
}

/* --- Formulaire --- */
.contact-form-wrapper h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-xl);
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-lg);
}

.field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.field label.required::after {
  content: " *";
  color: var(--color-error);
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.field .item {
  width: 100%;
  padding: 0.75rem var(--space-md);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field select.item {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.field .item:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.field .item::placeholder {
  color: var(--color-text-muted);
}

/* --- Phone group (country select + input) --- */
.phone-group {
  display: flex;
  gap: 0;
}

.phone-group .item.phone-country {
  width: 105px;
  min-width: 105px;
  flex: 0 0 105px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: none;
  padding: 0.75rem 1.8rem 0.75rem 0.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  appearance: none;
  cursor: pointer;
  font-size: var(--text-sm);
}

.phone-group .item.phone-input {
  flex: 1;
  width: auto;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.field textarea.item {
  resize: vertical;
  min-height: 130px;
}

/* Field footer (error + char count) */
.field-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xs);
}

.char-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-left: auto;
}

/* Error states */
.field .error-txt {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--space-xs);
  display: none;
}

.field.error .item {
  border-color: var(--color-error);
}

.field.error .item:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Only show the error-txt matching the active data-error type */
.field.error .error-txt.active {
  display: block;
}

/* Fallback: fields with a single error-txt (no data-error) show it directly */
.field.error .error-txt:only-of-type {
  display: block;
}

/* Consent checkbox */
.field-consent {
  margin-bottom: var(--space-md);
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1.5;
}

.consent-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
}

.consent-label a {
  color: var(--color-accent);
  text-decoration: underline;
}

.required-star {
  color: var(--color-error);
  font-weight: 700;
}

/* Required note */
.form-required-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* Submit button */
.btn-submit {
  width: 100%;
  justify-content: center;
  padding: 0.875rem;
  margin-top: var(--space-sm);
  font-size: var(--text-base);
  gap: var(--space-sm);
}

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

.btn-loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Feedback messages */
.form-feedback {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
}

.form-feedback.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-feedback.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.hidden {
  display: none !important;
}

/* --- Info cards --- */
.contact-info h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-xl);
}

.info-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.info-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

a.info-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.info-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-light);
  border-radius: var(--radius-sm);
}

.info-icon svg {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
}

.info-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 2px;
}

.info-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.info-hint {
  font-size: 0.7rem;
  font-style: italic;
  margin-top: 3px;
  opacity: 0.7;
  line-height: 1.4;
}

/* --- Map section --- */
.map-section {
  padding: 0 0 var(--space-4xl);
}

.map-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.map-wrapper iframe {
  width: 100%;
  height: 400px;
  border: 0;
  display: block;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
}

@media (max-width: 640px) {
  .contact-hero-title {
    font-size: var(--text-3xl);
  }

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

  .map-wrapper iframe {
    height: 280px;
  }
}
