/* CF7 — styled for DT Company theme */

.dt-cf7-wrap {
  margin-top: 1.25rem;
}

/* English forms — force LTR layout */
body.dt-lang-en .dt-cf7-wrap,
body.dt-lang-en .dt-cf7-wrap .wpcf7,
body.dt-lang-en .dt-cf7-wrap .wpcf7-form {
  direction: ltr;
  text-align: left;
}

body.dt-lang-en .wpcf7-form label {
  text-align: left;
}

body.dt-lang-en .wpcf7-form input[type="text"],
body.dt-lang-en .wpcf7-form input[type="email"],
body.dt-lang-en .wpcf7-form input[type="tel"],
body.dt-lang-en .wpcf7-form input[type="url"],
body.dt-lang-en .wpcf7-form select,
body.dt-lang-en .wpcf7-form textarea {
  direction: ltr;
  text-align: left;
}

body.dt-lang-en .wpcf7-form input[type="submit"],
body.dt-lang-en .wpcf7-form button[type="submit"] {
  direction: ltr;
}

body.dt-lang-en .wpcf7-not-valid-tip {
  text-align: left;
}

body.dt-lang-en .wpcf7-response-output {
  text-align: left;
}

/* Persian forms */
body.dt-lang-fa .dt-cf7-wrap,
body.dt-lang-fa .dt-cf7-wrap .wpcf7,
body.dt-lang-fa .dt-cf7-wrap .wpcf7-form {
  direction: rtl;
  text-align: right;
}

body.dt-lang-fa .wpcf7-form label {
  text-align: right;
}

body.dt-lang-fa .wpcf7-form input[type="tel"] {
  direction: ltr;
  text-align: left;
}

body.dt-lang-fa .wpcf7-form input[type="email"] {
  direction: ltr;
  text-align: left;
}

.wpcf7-form .dt-cf7-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.1rem;
}

.wpcf7-form .dt-cf7-full {
  grid-column: 1 / -1;
}

.wpcf7-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-teal);
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form select,
.wpcf7-form textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--white);
  font: inherit;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7-form input:focus,
.wpcf7-form select:focus,
.wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--brand-lime);
  box-shadow: 0 0 0 3px rgba(136, 192, 64, 0.2);
}

.wpcf7-form textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.cta-band .quote-form .wpcf7-form textarea {
  min-height: 3.25rem;
}

.wpcf7-form input[type="submit"],
.wpcf7-form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-lime), var(--brand-lime-dark));
  color: var(--brand-teal-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7-form input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(136, 192, 64, 0.35);
}

.wpcf7-not-valid-tip {
  color: #c0392b;
  font-size: 0.78rem;
  font-weight: 500;
}

.wpcf7-response-output {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
}

.wpcf7 form.sent .wpcf7-response-output {
  border-color: var(--brand-lime);
  background: var(--brand-lime-soft);
  color: var(--brand-teal);
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output {
  border-color: #e57373;
  background: #fdecea;
  color: #922b21;
}

.wpcf7-spinner {
  margin-inline-start: 0.5rem;
}

/* Homepage CTA band — CF7 quote form (glass panel) */
.cta-band .quote-form .dt-cf7-wrap {
  margin-top: 0;
}

.cta-band .quote-form .wpcf7-form .dt-cf7-grid {
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.cta-band .quote-form .wpcf7-form label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
}

.cta-band .quote-form .wpcf7-form input[type="text"],
.cta-band .quote-form .wpcf7-form input[type="email"],
.cta-band .quote-form .wpcf7-form input[type="tel"],
.cta-band .quote-form .wpcf7-form select,
.cta-band .quote-form .wpcf7-form textarea {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--white);
}

.cta-band .quote-form .wpcf7-form input::placeholder,
.cta-band .quote-form .wpcf7-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.cta-band .quote-form .wpcf7-form input:focus,
.cta-band .quote-form .wpcf7-form select:focus,
.cta-band .quote-form .wpcf7-form textarea:focus {
  border-color: var(--brand-lime);
  box-shadow: none;
}

.cta-band .quote-form .wpcf7-form select option {
  color: var(--ink);
}

.cta-band .quote-form .wpcf7-form input[type="submit"] {
  width: 100%;
  margin-top: 0.35rem;
}

.cta-band .quote-form .wpcf7-not-valid-tip {
  color: #ffb4b4;
}

.cta-band .quote-form .wpcf7-response-output {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
}

.cta-band .quote-form .wpcf7 form.sent .wpcf7-response-output {
  border-color: var(--brand-lime);
  background: rgba(136, 192, 64, 0.2);
  color: var(--white);
}

@media (max-width: 700px) {
  .wpcf7-form .dt-cf7-grid {
    grid-template-columns: 1fr;
  }
}

.wpcf7-form label .dt-phone-intl-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.7;
  margin-top: -0.15rem;
}

/* English — searchable country code + phone */
.dt-phone-intl {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--white);
  overflow: visible;
}

.dt-phone-intl:focus-within {
  border-color: var(--brand-lime);
  box-shadow: 0 0 0 3px rgba(136, 192, 64, 0.2);
}

.dt-phone-cc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.75rem 0.7rem;
  border: 0;
  border-inline-end: 1px solid var(--line);
  border-radius: 0.75rem 0 0 0.75rem;
  background: #f3f6f4;
  color: var(--brand-teal-deep);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.dt-phone-cc-flag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.dt-phone-cc-caret {
  width: 0.4rem;
  height: 0.4rem;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-20%) rotate(45deg);
  opacity: 0.65;
}

.dt-phone-intl .dt-phone-local,
.dt-phone-intl input.wpcf7-tel,
.dt-phone-intl input[type="tel"] {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 0.75rem 0.75rem 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.dt-phone-cc-panel {
  position: absolute;
  z-index: 40;
  inset-inline-start: 0;
  top: calc(100% + 0.35rem);
  width: min(100%, 22rem);
  max-width: 90vw;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 14px 36px rgba(0, 36, 42, 0.18);
  overflow: hidden;
}

.dt-phone-cc-search {
  width: 100% !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.7rem 0.85rem !important;
  font: inherit;
}

.dt-phone-cc-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 14rem;
  overflow-y: auto;
}

.dt-phone-cc-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.dt-phone-cc-option:hover,
.dt-phone-cc-option.is-active {
  background: rgba(136, 192, 64, 0.14);
}

.dt-phone-cc-opt-dial {
  color: var(--brand-teal);
  font-weight: 700;
  direction: ltr;
}

.dt-phone-cc-empty {
  padding: 0.85rem;
  color: #64748b;
  font-size: 0.85rem;
}

.cta-band .quote-form .dt-phone-intl {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.cta-band .quote-form .dt-phone-cc-btn {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  border-inline-end-color: rgba(255, 255, 255, 0.2);
}

.cta-band .quote-form .dt-phone-intl .dt-phone-local {
  color: #fff !important;
}

.cta-band .quote-form .dt-phone-intl .dt-phone-local::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* Native country+phone row (works without JS) */
.dt-phone-intl {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--white);
  overflow: visible;
}

.dt-phone-intl .wpcf7-form-control-wrap {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.dt-phone-intl .wpcf7-form-control-wrap[data-name="your-phone"] {
  flex: 1 1 auto;
  min-width: 8rem;
}

.dt-phone-intl .wpcf7-form-control-wrap[data-name="country-code"] {
  flex: 0 0 auto;
  max-width: 12.5rem;
  border-inline-end: 1px solid var(--line);
}

.dt-phone-intl select.dt-phone-cc-native,
.dt-phone-intl select[name="country-code"] {
  width: 100%;
  max-width: 12.5rem;
  border: 0 !important;
  border-radius: 0.75rem 0 0 0.75rem !important;
  box-shadow: none !important;
  background: #f3f6f4 !important;
  font-weight: 700;
  padding-inline: 0.65rem !important;
}

.dt-phone-intl input.dt-phone-local,
.dt-phone-intl input[name="your-phone"] {
  border: 0 !important;
  border-radius: 0 0.75rem 0.75rem 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.dt-phone-intl:focus-within {
  border-color: var(--brand-lime);
  box-shadow: 0 0 0 3px rgba(136, 192, 64, 0.2);
}

/* When JS enhances, hide native select visually but keep for CF7 */
.dt-phone-intl .dt-phone-cc-native-hidden,
.dt-phone-intl select.dt-phone-cc-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.dt-phone-intl .wpcf7-form-control-wrap[data-name="country-code"]:has(select.dt-phone-cc-native-hidden) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  border: 0;
}

.dt-phone-cc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.75rem 0.7rem;
  border: 0;
  border-inline-end: 1px solid var(--line);
  border-radius: 0.75rem 0 0 0.75rem;
  background: #f3f6f4;
  color: var(--brand-teal-deep);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  max-width: 13rem;
}

.dt-phone-cc-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7rem;
  font-weight: 600;
  opacity: 0.85;
}

.dt-phone-cc-dial {
  font-weight: 800;
  direction: ltr;
}

.dt-phone-cc-caret {
  width: 0.4rem;
  height: 0.4rem;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-20%) rotate(45deg);
  opacity: 0.65;
  flex-shrink: 0;
}

.dt-phone-cc-panel {
  position: absolute;
  z-index: 50;
  inset-inline-start: 0;
  top: calc(100% + 0.35rem);
  width: min(100%, 22rem);
  max-width: 90vw;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 14px 36px rgba(0, 36, 42, 0.18);
  overflow: hidden;
}

.dt-phone-cc-search {
  width: 100% !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.7rem 0.85rem !important;
  font: inherit;
}

.dt-phone-cc-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 14rem;
  overflow-y: auto;
}

.dt-phone-cc-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.dt-phone-cc-option:hover,
.dt-phone-cc-option.is-active {
  background: rgba(136, 192, 64, 0.14);
}

.dt-phone-cc-opt-dial {
  color: var(--brand-teal);
  font-weight: 700;
  direction: ltr;
}

.dt-phone-cc-empty {
  padding: 0.85rem;
  color: #64748b;
  font-size: 0.85rem;
}

.cta-band .quote-form .dt-phone-intl {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.cta-band .quote-form .dt-phone-cc-btn,
.cta-band .quote-form .dt-phone-intl select.dt-phone-cc-native {
  background: rgba(0, 0, 0, 0.2) !important;
  color: #fff !important;
}

.cta-band .quote-form .dt-phone-intl input.dt-phone-local {
  color: #fff !important;
}
