/* ===========================================================================
   form-bridge.css — MONA Smart Form dressed as a Senna form.

   Smart Form renders a flat list of `<p class="msf-field" data-key="…">`
   (class-msf-form.php:167). It has no notion of columns, while the static build
   groups its inputs as `.cform > .two > .fr` (page.css:97). Rather than fork the
   plugin, the grouping is rebuilt here from `data-key`, so the plugin keeps
   ownership of entries, mail, validation and spam handling.

   Loaded after the plugin's own assets/form.css and after page.css, and every
   rule is scoped to `.cform` or `.cta-form` — nothing here reaches a Smart Form
   placed anywhere else.

   Which key sits in which column is per-form, because the same key pairs
   differently on the two pages (`email` is half-width on Liên hệ and full-width
   on Đặt phòng). The form's own id, set in the Smart Form screen, scopes it.
   =========================================================================== */

/* ---------- the boxed form: dat-phong.html, lien-he.html ---------- */

/* `.cform` is the wrapper div; the <form> inside carries the column grid, so the
   heading above it stays a sibling exactly as in the static markup. */
.cform > .msf-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 30px;
  max-width: none;
  margin: 0;
}

/* Default: one field per row. Pairs opt in below. */
.cform .msf-form .msf-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.cform .msf-form .msf-field label {
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.cform .msf-form .msf-req { color: var(--accent); }

.cform .msf-form input,
.cform .msf-form textarea,
.cform .msf-form select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 12px 2px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 300;
  box-shadow: none;
}

.cform .msf-form input:focus,
.cform .msf-form textarea:focus,
.cform .msf-form select:focus {
  outline: none;
  border-bottom-color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.cform .msf-form .msf-status { grid-column: 1 / -1; }

/* The submit button is the one <p> that is not a field. */
.cform .msf-form > p:not(.msf-field) {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 10px 0 0;
}

/* Repeats .cbtn.solid (concept3.css:43-52). The plugin prints a <button> with a
   fixed class, so the look cannot be reached by adding `.cbtn` to it. */
.cform .msf-form .msf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-family: var(--sans);
  font-size: .64rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  font-weight: 500;
  color: #fff;
  padding: 17px 40px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: color .55s var(--ease), border-color .55s var(--ease);
}

.cform .msf-form .msf-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .55s var(--ease);
  z-index: -1;
}

.cform .msf-form .msf-btn:hover { color: #fff; border-color: var(--accent); }
.cform .msf-form .msf-btn:hover::before { transform: scaleX(1); transform-origin: left center; }
.cform .msf-form .msf-btn:disabled::before { transform: scaleX(0); }

/* ---------- which fields share a row ---------- */

/* Đặt phòng — dat-phong.html:59-70: three pairs, then three full rows. */
#bookingForm .msf-field[data-key="checkin"],
#bookingForm .msf-field[data-key="checkout"],
#bookingForm .msf-field[data-key="guests"],
#bookingForm .msf-field[data-key="room"],
#bookingForm .msf-field[data-key="name"],
#bookingForm .msf-field[data-key="phone"] { grid-column: span 1; }

/* Liên hệ — lien-he.html:26-36: two pairs, then the message. */
#contactForm .msf-field[data-key="name"],
#contactForm .msf-field[data-key="email"],
#contactForm .msf-field[data-key="phone"],
#contactForm .msf-field[data-key="topic"] { grid-column: span 1; }

/* Matches page.css:158 — the pairs collapse at the same width the `.two` do. */
@media (max-width: 760px) {
  .cform > .msf-form { grid-template-columns: 1fr; gap: 22px; }
  .cform .msf-form .msf-field { grid-column: 1 / -1; }
}

/* ---------- the newsletter line: uu-dai.html:150 ---------- */

.cta-form .msf-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
  border-bottom: 1px solid var(--ink);
}

/* .cta p (page.css:104) centres and constrains every paragraph in the band. */
.cta-form .msf-form p {
  margin: 0;
  max-width: none;
  color: inherit;
  font-weight: inherit;
}

.cta-form .msf-form .msf-field { flex: 1; display: block; }

/* The static input has only an aria-label. Keep the real label for screen
   readers rather than dropping it. */
.cta-form .msf-form .msf-field label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cta-form .msf-form input {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px 4px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 300;
  box-shadow: none;
}

.cta-form .msf-form input:focus { outline: none; background: transparent; box-shadow: none; }

.cta-form .msf-form .msf-btn {
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font-family: var(--sans);
  font-size: .64rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink);
}

.cta-form .msf-form .msf-btn:hover { color: var(--accent); filter: none; }

/* Wrap the response under the line instead of squeezing the input. */
.cta-form .msf-form .msf-status { flex: 0 0 100%; order: 3; text-align: left; }
