/* Floréaf: form đặt hoa (ô chọn, ngày giao), modal đặt hoa (OrderModal.tsx + js/order.js) và ba nút liên hệ tròn
   ở góc phải dưới trên máy tính (SiteFooter.tsx). Nạp sau floreaf.css và pages.css. */

/* ---------- form ---------- */
/* mỗi ô canh từ trên: dòng phụ dưới một ô (ngày kiểu Việt, báo lỗi) không đẩy lệch ô bên cạnh */
.form .field { align-content: start; }
/* ô chọn: mũi tên tự vẽ cách mép phải 16px như ô lọc ở /mau-hoa (mũi tên của trình duyệt dính sát mép phải) */
.form select {
  -webkit-appearance: none; appearance: none; padding-right: 44px; text-overflow: ellipsis; cursor: pointer;
  background: #fffdf9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%233b4a2f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 16px center / 12px no-repeat;
}
.form select:disabled { cursor: not-allowed; color: rgb(31 42 30 / .5); background-color: rgb(255 253 249 / .55); opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23a3ab9c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
/* ngày giao: bộ chọn ngày của trình duyệt, chữ canh trái (Safari iOS canh giữa) */
.form input[type="date"] { display: block; min-height: var(--btn-h); padding-right: 12px; text-align: left; cursor: pointer; }
.form input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.form input[type="date"]::-webkit-calendar-picker-indicator { padding: 6px; margin-right: 2px; border-radius: 8px; cursor: pointer; opacity: .75; transition: background-color .25s, opacity .25s; }
.form input[type="date"]::-webkit-calendar-picker-indicator:hover { background-color: rgb(59 74 47 / .1); opacity: 1; }
.form :is(input, textarea)::placeholder { color: rgb(31 42 30 / .42); }
/* ngày đã chọn, viết kiểu Việt (order.js) */
.field__hint { margin: -2px 0 0; font: 500 13px/1.3 var(--font-text); color: var(--fl-moss); }
.field__hint:empty { display: none; }
/* form = thân (lưới hai cột các ô) + chân (nút gửi, dòng trạng thái, lời hẹn); ngoài modal trông như lưới .form của bộ kit */
.form.fl-orderform { display: flex; flex-direction: column; gap: var(--s-4); }
.fl-orderform__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.fl-orderform__body > .field--full { grid-column: 1 / -1; }
.fl-orderform__foot { display: grid; gap: var(--s-4); }
@media (max-width: 639px) { .fl-orderform__body { grid-template-columns: minmax(0, 1fr); } }

/* ---------- modal đặt hoa ---------- */
html:has(.fl-modal[open]) { overflow: hidden; }
.fl-modal { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: clamp(16px, 4vh, 40px) 16px;
  border: 0; background: transparent; color: var(--fl-ink); overflow: hidden; }
.fl-modal[open] { display: grid; place-items: center; grid-template-rows: minmax(0, 1fr); }
.fl-modal::backdrop { background: rgb(31 42 30 / .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* khung: đầu (tiêu đề) và chân (nút gửi) đứng yên, chỉ thân form cuộn, và chỉ cuộn dọc. Khung không cuộn và cắt mọi thứ
   lố ra ngoài (vệt màu nước ở góc), nên không bao giờ có thanh cuộn ngang; bề ngang theo nội dung, tối đa 760px */
.fl-modal { --pad: clamp(24px, 3.6vw, 48px); }
.fl-modal__panel { position: relative; isolation: isolate; width: min(100%, 760px); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; overflow: clip;
  border-radius: 28px; background: #fbf8f2; box-shadow: 0 40px 90px -30px rgb(31 42 30 / .6); }
/* một vệt màu nước và nhành bạch đàn ở góc trên, như góc các mục trên trang */
.fl-modal__panel::before { content: ""; position: absolute; z-index: -1; top: -40px; right: -60px; width: 300px; aspect-ratio: 560 / 474;
  background: url(../brand/wc/wash.webp) center / contain no-repeat; opacity: .35; pointer-events: none; }
.fl-modal__panel::after { content: ""; position: absolute; z-index: -1; top: 8px; right: 64px; width: 92px; aspect-ratio: 240 / 297;
  background: url(../brand/wc/sprig-euca-s.webp) center / contain no-repeat; opacity: .55; transform: rotate(-8deg); pointer-events: none; }
.fl-modal__close { position: absolute; z-index: 2; top: 16px; right: 16px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .85); color: var(--fl-ink); cursor: pointer; box-shadow: 0 0 0 1px rgb(31 42 30 / .08); transition: background-color .25s var(--fl-ease), transform .3s var(--fl-ease); }
.fl-modal__close:hover { background: #fff; transform: rotate(90deg); }
.fl-modal__close:focus-visible { outline: 2px solid var(--fl-moss); outline-offset: 2px; }
.fl-modal__close svg { width: 20px; height: 20px; }
.fl-modal__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* đầu: đứng yên; có đường kẻ dưới khi thân đã cuộn xuống (order.js đặt .is-scrolled) */
.fl-modal__head { flex: none; display: grid; gap: 10px; justify-items: start; padding: var(--pad) calc(var(--pad) + 44px) 18px var(--pad);
  border-bottom: 1px solid transparent; transition: border-color .25s; }
.fl-modal__panel.is-scrolled .fl-modal__head { border-bottom-color: rgb(31 42 30 / .1); }
.fl-modal__head h2, .fl-modal__done h2 { margin: 0; font: 400 clamp(30px, 3vw, 42px)/1.08 var(--font-display); letter-spacing: -0.01em; color: var(--fl-ink); }
.fl-modal :is(h2) em { font-style: italic; color: var(--fl-moss); }
.fl-modal__ctx { margin: 2px 0 0; max-width: 56ch; font-size: 15px; line-height: 1.55; color: #4f5a48; }
.fl-modal__ctx[hidden] { display: none; }
/* thân: phần duy nhất cuộn, chỉ cuộn dọc; lề trong rộng để viền báo lỗi và viền focus của ô không bị cắt */
.fl-modal .fl-orderform { flex: 1 1 auto; min-height: 0; gap: 0; }
.fl-modal .fl-orderform__body { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  gap: 14px 16px; padding: 6px var(--pad) 24px; }
.fl-modal .form .field textarea { min-height: 88px; }
/* chân: luôn hiện ở đáy khung; nút gửi bên trái, lời hẹn bên phải, dòng trạng thái (còn ô cần sửa, đang gửi…) ở trên */
.fl-modal .fl-orderform__foot { flex: none; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "status status" "btn note"; align-items: center; gap: 10px 20px;
  padding: 16px var(--pad) 20px; border-top: 1px solid rgb(31 42 30 / .1); background: #fbf8f2; }
.fl-modal .fl-orderform__foot > .btn-row { grid-area: btn; margin: 0; }
.fl-modal .fl-orderform__foot > .form__status { grid-area: status; margin: 0; font-weight: 600; }
.fl-modal .fl-orderform__foot > .form__status:empty { display: none; }
.fl-modal .fl-orderform__foot > .t-small { grid-area: note; margin: 0; max-width: 42ch; font-size: 13px; line-height: 1.45; color: #4f5a48; }
/* đã gửi: lời cảm ơn thay chỗ form */
.fl-modal__done { display: grid; justify-items: center; gap: 16px; padding: calc(var(--pad) + 12px) var(--pad) var(--pad); overflow-y: auto; text-align: center; }
.fl-modal__done[hidden], .fl-modal__body[hidden] { display: none; }
.fl-modal__done h2:focus { outline: none; }
.fl-modal__done p { margin: 0; max-width: 44ch; font-size: 17px; line-height: 1.6; color: #2f3a2d; }
.fl-modal__done .btn-row { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.fl-modal__tick { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; color: var(--fl-cream); background: var(--fl-moss); box-shadow: 0 16px 30px -14px rgb(59 74 47 / .8); }
.fl-modal__tick svg { width: 34px; height: 34px; }
@media (prefers-reduced-motion: no-preference) {
  .fl-modal[open] .fl-modal__panel { animation: fl-modal-in .5s var(--fl-ease) both; }
  .fl-modal[open]::backdrop { animation: fl-modal-fade .3s ease both; }
  .fl-modal__done:not([hidden]) .fl-modal__tick { animation: fl-modal-pop .6s var(--fl-ease) both .05s; }
}
@keyframes fl-modal-in { from { opacity: 0; transform: translateY(28px) scale(.98); } }
@keyframes fl-modal-fade { from { opacity: 0; } }
@keyframes fl-modal-pop { from { opacity: 0; transform: scale(.6); } }
/* điện thoại: khung trượt lên từ đáy màn hình, kéo dài gần hết chiều cao */
@media (max-width: 639px) {
  .fl-modal { padding: 0; --pad: 18px; }
  .fl-modal[open] { place-items: end stretch; }
  .fl-modal__panel { width: 100%; max-height: 94svh; border-radius: 24px 24px 0 0; }
  .fl-modal__head { padding-top: 26px; padding-bottom: 14px; }
  .fl-modal__close { top: 12px; right: 12px; }
  .fl-modal__panel::after { display: none; }
  /* chân trên điện thoại: chỉ nút gửi, trải hết bề ngang (lời hẹn 30 phút đã có trong lời cảm ơn sau khi gửi) */
  .fl-modal .fl-orderform__foot { grid-template-columns: minmax(0, 1fr); grid-template-areas: "status" "btn"; gap: 8px; padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .fl-modal .fl-orderform__foot > .t-small { display: none; }
  .fl-modal .fl-orderform__foot .btn-row { display: flex; }
  .fl-modal .fl-orderform__foot .btn { width: 100%; justify-content: center; }
  @media (prefers-reduced-motion: no-preference) { .fl-modal[open] .fl-modal__panel { animation-name: fl-modal-up; } }
}
@keyframes fl-modal-up { from { transform: translateY(100%); } }

/* ---------- ba nút liên hệ tròn ở góc phải dưới (từ 768px; điện thoại có thanh .fl-dock) ---------- */
.fl-float { display: none; }
@media (min-width: 768px) {
  .fl-float { position: fixed; z-index: 40; right: clamp(12px, 1.4vw, 20px); bottom: clamp(16px, 2.4vw, 28px); display: grid; gap: 12px; }
  .fl-float__item { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--fl-ink); text-decoration: none;
    box-shadow: 0 14px 28px -12px rgb(31 42 30 / .55), 0 0 0 1px rgb(31 42 30 / .06); transition: translate .35s var(--fl-ease), box-shadow .35s var(--fl-ease); -webkit-tap-highlight-color: transparent; }
  .fl-float__item:hover { translate: 0 -3px; box-shadow: 0 20px 34px -12px rgb(31 42 30 / .55), 0 0 0 1px rgb(31 42 30 / .06); }
  .fl-float__item:focus-visible { outline: 2px solid var(--fl-moss); outline-offset: 3px; }
  .fl-float__ic { display: grid; place-items: center; pointer-events: none; }
  .fl-float__item--zalo .fl-float__ic img { width: 36px; height: auto; }
  .fl-float__item--msg .fl-float__ic img { width: 30px; height: 30px; }
  /* viền giấy như nút gọi của thanh dock: nút rêu vẫn rõ trên nền footer rêu đậm */
  .fl-float__item--call { background: var(--fl-moss); color: var(--fl-cream); border: 3px solid var(--fl-paper); }
  .fl-float__item--call svg { width: 24px; height: 24px; }
  .fl-float__item--call::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--fl-moss); animation: fl-ping 2.4s var(--fl-ease) infinite; pointer-events: none; }
  /* tên nút hiện bên trái khi rê chuột hoặc chọn bằng phím */
  .fl-float__label { position: absolute; right: calc(100% + 12px); top: 50%; translate: 8px -50%; padding: 9px 14px; border-radius: 999px; white-space: nowrap;
    background: var(--fl-ink); color: var(--fl-cream); font: 600 13px/1 var(--font-text); letter-spacing: .01em; opacity: 0; pointer-events: none;
    transition: opacity .25s var(--fl-ease), translate .35s var(--fl-ease); }
  .fl-float__item:is(:hover, :focus-visible) .fl-float__label { opacity: 1; translate: 0 -50%; }
  html:has(header.nav.is-open) .fl-float { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fl-float__item--call::after { animation: none; display: none; } }
@media print { .fl-float, .fl-dock { display: none !important; } }
