/* ============================================================
   Makreate quote form — clean, consistent fields.
   Persistent labels above each field. No floating, no overlap.
   ============================================================ */

.mk-form-host {
  font-family: "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  padding: 28px 26px 22px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.10),
    0 4px 12px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.mk-form-host * {
  box-sizing: border-box;
  font-family: inherit;
}

.mk-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === FIELD ROW =============================================== */
.mk-form-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mk-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
  padding: 0 2px;
  user-select: none;
  transition: color 0.15s;
}

.mk-input,
.mk-textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  background: #fafafa;
  border: 1.5px solid #e8e8eb;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #111;
  padding: 14px 16px;
  line-height: 1.4;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
  font-family: inherit;
  height: 50px;
}

.mk-textarea {
  resize: vertical;
  min-height: 96px;
  height: auto;
  padding: 14px 16px;
  line-height: 1.5;
}

.mk-input::placeholder,
.mk-textarea::placeholder {
  color: #9aa0a6;
  font-weight: 500;
}

.mk-input:hover,
.mk-textarea:hover {
  border-color: #d1d1d6;
  background: #fff;
}

.mk-input:focus,
.mk-textarea:focus {
  outline: none;
  border-color: #E51A1C;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(229, 26, 28, 0.10);
}

.mk-form-row:focus-within .mk-label {
  color: #E51A1C;
}

/* === PHONE FIELD ============================================
   Picker and input are siblings in a flex row — no absolute
   positioning, no overlap. Immune to legacy WP/Elementor
   `input[type=tel]{padding-left:…}` rules from cached theme CSS. */
.mk-form-phone { position: relative; }
.mk-form-phone .mk-phone-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  background: #fafafa;
  border: 1.5px solid #e8e8eb;
  border-radius: 12px;
  height: 50px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.mk-form-phone .mk-phone-wrap:hover { border-color: #d1d1d6; background: #fff; }
.mk-form-phone .mk-phone-wrap:focus-within {
  border-color: #E51A1C;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(229, 26, 28, 0.10);
}

/* Country picker — fixed-width segment on the left */
.mk-cc {
  flex: 0 0 auto;
  width: 104px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 0;
  border-right: 1px solid #e8e8eb;
  border-radius: 11px 0 0 11px;
  margin: 0;
  padding: 0 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mk-form-phone .mk-phone-wrap:focus-within .mk-cc { border-right-color: #E51A1C; }

/* The phone input fills the rest of the row. We override the standalone
   .mk-input border/background/height so it visually merges with the
   wrapper. !important defeats legacy WP/Elementor input[type=tel] rules. */
.mk-form-phone .mk-input-phone,
.mk-form-host input[type="tel"].mk-input-phone {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 11px 11px 0 !important;
  height: 100% !important;
  padding: 0 16px !important;
  box-shadow: none !important;
}
.mk-form-phone .mk-input-phone:focus,
.mk-form-host input[type="tel"].mk-input-phone:focus {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.mk-cc:hover { background: rgba(229, 26, 28, 0.08); color: #E51A1C; }
.mk-cc:focus-visible { outline: 2px solid #E51A1C; outline-offset: 2px; }

.mk-cc-flag { font-size: 16px; line-height: 1; }
.mk-cc-dial { font-size: 13.5px; font-weight: 600; color: #444; }
.mk-cc-caret { color: #888; flex-shrink: 0; transition: transform 0.18s; }
.mk-cc[aria-expanded="true"] .mk-cc-caret { transform: rotate(180deg); }
.mk-cc:hover .mk-cc-dial,
.mk-cc:hover .mk-cc-caret { color: #E51A1C; }

/* === COUNTRY DROPDOWN ======================================= */
.mk-cc-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: 300px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mk-cc-menu[hidden] { display: none; }

.mk-cc-search {
  border: 0;
  border-bottom: 1px solid #ececec;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fafafa;
  color: #111;
}
.mk-cc-search::placeholder { color: #888; }
.mk-cc-search:focus { background: #fff; }

.mk-cc-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1;
}
.mk-cc-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #222;
  transition: background 0.12s;
}
.mk-cc-list li:hover {
  background: #fff5f5;
  color: #E51A1C;
}
.mk-cc-list li[aria-selected="true"] {
  background: #fff5f5;
  color: #E51A1C;
  font-weight: 700;
}
.mk-cc-list-flag { font-size: 18px; line-height: 1; }
.mk-cc-list-name { flex: 1; }
.mk-cc-list-dial { color: #888; font-size: 13px; }

/* === SUBMIT BUTTON ========================================== */
.mk-submit {
  position: relative;
  margin-top: 6px;
  padding: 16px 28px;
  background: linear-gradient(135deg, #E51A1C 0%, #b81113 100%);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(229, 26, 28, 0.28);
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.mk-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(229, 26, 28, 0.36);
}

.mk-submit:active:not(:disabled) { transform: translateY(0); }
.mk-submit:focus-visible { outline: 3px solid rgba(229, 26, 28, 0.40); outline-offset: 2px; }

.mk-submit-arrow { transition: transform 0.18s; }
.mk-submit:hover .mk-submit-arrow { transform: translateX(3px); }

.mk-submit-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mk-spin 0.6s linear infinite;
}
@keyframes mk-spin { to { transform: rotate(360deg); } }

.mk-submit.is-loading .mk-submit-spinner { display: inline-block; }
.mk-submit.is-loading .mk-submit-arrow { display: none; }
.mk-submit.is-loading {
  pointer-events: none;
  background: linear-gradient(135deg, #c2151c 0%, #9c0e10 100%);
}

.mk-submit.is-done {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(22, 101, 52, 0.30);
}
.mk-submit.is-done .mk-submit-arrow { display: none; }
.mk-submit.is-done::before {
  content: "";
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M3 8l3.5 3.5L13 5' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* === STATUS / TRUST ========================================= */
.mk-trust {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: #777;
  font-weight: 500;
}

.mk-status {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}
.mk-status:empty { display: none; }
.mk-status-success {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}
.mk-status-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}

/* === ERROR STATE ============================================ */
.mk-form-row.has-error .mk-input,
.mk-form-row.has-error .mk-textarea {
  border-color: #ef4444;
  background: #fef2f2;
}
.mk-form-row.has-error .mk-label { color: #b91c1c; }

/* === DARK THEME ============================================ */
.mk-form-host.mk-form-dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.mk-form-dark .mk-label { color: rgba(255, 255, 255, 0.72); }
.mk-form-dark .mk-form-row:focus-within .mk-label { color: #fff; }
.mk-form-dark .mk-input,
.mk-form-dark .mk-textarea {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.mk-form-dark .mk-input::placeholder,
.mk-form-dark .mk-textarea::placeholder { color: rgba(255, 255, 255, 0.45); }
.mk-form-dark .mk-input:hover,
.mk-form-dark .mk-textarea:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.30);
}
.mk-form-dark .mk-input:focus,
.mk-form-dark .mk-textarea:focus {
  background: rgba(255, 255, 255, 0.10);
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14);
}
.mk-form-dark .mk-form-phone .mk-phone-wrap {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}
.mk-form-dark .mk-form-phone .mk-phone-wrap:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.30);
}
.mk-form-dark .mk-form-phone .mk-phone-wrap:focus-within {
  background: rgba(255, 255, 255, 0.10);
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14);
}
.mk-form-dark .mk-cc {
  background: transparent;
  border-right-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.mk-form-dark .mk-cc:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
.mk-form-dark .mk-cc-dial { color: rgba(255, 255, 255, 0.85); }
.mk-form-dark .mk-cc-caret { color: rgba(255, 255, 255, 0.6); }
.mk-form-dark .mk-cc-menu { background: #1a1a1a; border-color: rgba(255, 255, 255, 0.12); }
.mk-form-dark .mk-cc-search { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.12); color: #fff; }
.mk-form-dark .mk-cc-list li { color: rgba(255, 255, 255, 0.85); }
.mk-form-dark .mk-cc-list li:hover { background: rgba(229, 26, 28, 0.18); color: #fff; }
.mk-form-dark .mk-cc-list-dial { color: rgba(255, 255, 255, 0.5); }
.mk-form-dark .mk-trust { color: rgba(255, 255, 255, 0.65); }

/* Webkit autofill */
.mk-input:-webkit-autofill,
.mk-textarea:-webkit-autofill {
  -webkit-text-fill-color: #111;
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  caret-color: #111;
}
.mk-form-dark .mk-input:-webkit-autofill,
.mk-form-dark .mk-textarea:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(40, 40, 40, 0.95) inset;
  caret-color: #fff;
}

/* === SMALL SCREENS ========================================== */
@media (max-width: 480px) {
  .mk-form-host {
    padding: 22px 18px 18px;
    border-radius: 16px;
  }
  .mk-cc-menu { max-height: 250px; }
  .mk-input, .mk-textarea {
    font-size: 16px; /* Prevent iOS zoom */
  }
  .mk-cc {
    width: 92px;
    font-size: 13.5px;
    padding: 0 8px;
  }
  .mk-cc-flag { font-size: 15px; }
  .mk-cc-dial { font-size: 13px; }
}
