/* ---------- Formular (parte din același panou .estimate-panel) ---------- */

.estimate-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 28px;
  color: var(--text-faint);
  font-weight: 700;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.estimate-divider::before,
.estimate-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field input,
.form-field textarea {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(241, 239, 233, 0.03);
  color: var(--text-primary);
  font-weight: 400;
}

.form-field textarea {
  min-height: 90px;
  resize: vertical;
}

.form-error {
  color: #ff8a80;
  font-weight: 700;
  font-size: 0.82rem;
}

.form-status {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius);
  font-weight: 700;
}

.form-status-success {
  background: rgba(16, 169, 194, 0.14);
  color: var(--cyan);
}

.form-status-error {
  background: rgba(255, 138, 128, 0.12);
  color: #ff8a80;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Honeypot anti-spam: scos din flux și invizibil, dar completabil de boți. */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Butoane de contact direct afișate sub mesajul de eroare al formularului. */
.form-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}


/* Nota de sub butonul de trimitere, cu link spre politica de confidențialitate. */
.form-legal {
  flex: 1 0 100%;
  margin: 0;
  color: var(--text-faint);
  font-size: 0.8rem;
  line-height: 1.5;
}

.form-legal a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-legal a:hover {
  color: var(--text-primary);
}

/* ---------- Câmp de telefon cu selector de țară (js/phone.js) ---------- */
/* Arată ca un singur input: [steag +373 ▾ | număr]. Bordura, înălțimea, raza și
   conturul de focus sunt cele ale celorlalte câmpuri (.form-field input). */

.phone-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.phone-control {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: stretch;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(241, 239, 233, 0.03);
  transition: border-color 0.2s ease;
}

.phone-control:focus-within {
  border-color: var(--cyan);
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.phone-field.is-invalid .phone-control {
  border-color: #ff8a80;
}

.phone-country {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 14px;
  border: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.phone-country:hover {
  background: rgba(241, 239, 233, 0.05);
}

.phone-flag {
  display: inline-flex;
  flex: 0 0 auto;
}

.phone-flag svg {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(241, 239, 233, 0.14);
}

.phone-chevron {
  display: inline-flex;
  color: var(--text-faint);
  transition: transform 0.2s ease;
}

.phone-field.is-open .phone-chevron {
  transform: rotate(180deg);
}

.phone-divider {
  flex: 0 0 1px;
  margin: 10px 0;
  background: var(--line);
}

/* Specificitate peste `.form-field input` / `.phone-gate-field input`: inputul din
   interior nu are bordură proprie; conturul de focus îl desenează .phone-control. */
.phone-control input,
.form-field .phone-control input,
.phone-gate-field .phone-control input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: left;
}

.phone-control input:focus-visible,
.phone-control button:focus-visible,
.phone-gate-field .phone-control input:focus-visible,
.phone-list:focus {
  outline: none;
}

.phone-list {
  position: absolute;
  top: calc(100% + 6px);
  left: -1px;
  z-index: 40;
  min-width: min(260px, calc(100vw - 48px));
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: var(--shadow);
}

.phone-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

.phone-option.is-active,
.phone-option:hover {
  background: var(--cyan-soft);
  color: var(--text-primary);
}

.phone-option[aria-selected="true"] {
  color: var(--text-primary);
}

.phone-option[aria-selected="true"] .phone-option-name::after {
  content: " ✓";
  color: var(--cyan);
}

.phone-option-dial {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.phone-note {
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
}

/* Varianta mare, centrată (pasul de telefon din calculator). */
.phone-field--lg {
  width: min(380px, 100%);
}

.phone-field--lg .phone-control {
  min-height: 56px;
  font-size: 1.15rem;
}

.phone-field--lg .phone-note,
.phone-field--lg .phone-error {
  text-align: center;
}

/* ---------- Modal „Vă sunăm noi" (js/notify.js) ---------- */
/* Același limbaj „blueprint" ca footer-ul și paginile legale: panou închis, linie
   teal, repere de colț. <dialog> nativ: focusul rămâne în modal, Esc închide. */

.callback-dialog {
  --cb-mark: rgba(26, 163, 181, 0.85);
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(26, 163, 181, 0.35);
  border-radius: var(--radius);
  background:
    linear-gradient(var(--cb-mark), var(--cb-mark)) left top / 14px 2px no-repeat,
    linear-gradient(var(--cb-mark), var(--cb-mark)) left top / 2px 14px no-repeat,
    linear-gradient(var(--cb-mark), var(--cb-mark)) right bottom / 14px 2px no-repeat,
    linear-gradient(var(--cb-mark), var(--cb-mark)) right bottom / 2px 14px no-repeat,
    var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.callback-dialog[open] {
  animation: callback-in 0.24s ease-out;
}

.callback-dialog::backdrop {
  background: rgba(5, 9, 11, 0.72);
  backdrop-filter: blur(3px);
}

@keyframes callback-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.callback-panel {
  position: relative;
  padding: 32px 28px 28px;
}

.callback-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.callback-close:hover {
  color: var(--text-primary);
  background: rgba(241, 239, 233, 0.06);
}

.callback-panel h2 {
  margin: 0 40px 8px 0;
  color: #fff;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.1;
}

.callback-intro {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.callback-form {
  display: grid;
  gap: 16px;
}

.callback-form select {
  min-height: 48px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(241, 239, 233, 0.03) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f989c' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center / 10px 6px;
  color: var(--text-primary);
  font: inherit;
  font-weight: 400;
  appearance: none;
}

.callback-form select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.callback-form .btn {
  width: 100%;
  margin-top: 4px;
}

.callback-dialog .form-status {
  margin-top: 0;
}

.callback-dialog .form-status a {
  color: inherit;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .callback-dialog {
    width: calc(100% - 24px);
  }

  .callback-panel {
    padding: 28px 20px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .callback-dialog[open] {
    animation: none;
  }

  .phone-chevron,
  .phone-control {
    transition: none;
  }
}

/* Câmpurile din grilă rămân aliniate sus când un vecin (telefonul, cu nota de sub el)
   face rândul mai înalt. */
.form-grid .form-field {
  align-content: start;
}
