/* =========================================================
   FlexiPrace.cz — formuláře (poptávka / nabídka / přihlášení)
   Navazuje na proměnné z style.css
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 32, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
}
.modal-overlay.is-open {
  display: flex;
}

.modal-box {
  background: var(--white);
  border-radius: 0;
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  padding: 0;
  box-shadow: var(--shadow-soft);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-box-inner {
  overflow-y: auto;
  padding: 40px 44px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--peach-bg);
  color: var(--brown-dark);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--peach-soft); }

.modal-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}
.modal-box.theme-help .modal-eyebrow { color: var(--orange-btn); }
.modal-box.theme-work .modal-eyebrow { color: var(--teal-dark); }

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: var(--ink);
}
.modal-sub {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-bottom: 22px;
}

.f-group { margin-bottom: 18px; }
.f-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.f-hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.f-input, .f-textarea, .f-select {
  width: 100%;
  border: 1.5px solid var(--peach-soft);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.15s ease;
}
.f-input:focus, .f-textarea:focus, .f-select:focus {
  outline: none;
  border-color: var(--teal-btn);
}
.f-textarea { min-height: 90px; resize: vertical; }

.f-row { display: flex; gap: 12px; }
.f-row .f-group { flex: 1; }

.f-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.f-choices .f-choice:last-child:nth-child(odd) { grid-column: 1 / -1; }

.f-choice {
  position: relative;
}
.f-choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.f-choice > span {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--peach-soft);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-soft);
  background: var(--white);
  transition: all 0.15s ease;
  cursor: pointer;
  box-sizing: border-box;
}
.f-choice > span::before {
  content: '';
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--peach-soft);
  flex-shrink: 0;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.f-choice:hover > span { border-color: var(--teal-btn); }

.f-choice input:checked + span {
  border-color: var(--brown-dark);
  background: var(--peach-bg);
  color: var(--ink);
}
.f-choice input:checked + span::before {
  border-width: 5px;
  border-color: var(--brown-dark);
}
.modal-box.theme-help .f-choice input:checked + span { border-color: var(--orange-btn); background: var(--peach-bg); }
.modal-box.theme-help .f-choice input:checked + span::before { border-color: var(--orange-btn); }
.modal-box.theme-help .f-choice input:checked + span .f-choice-title { color: var(--orange-hover); }
.modal-box.theme-work .f-choice input:checked + span { border-color: var(--teal-btn); background: var(--mint-bg); }
.modal-box.theme-work .f-choice input:checked + span::before { border-color: var(--teal-btn); }
.modal-box.theme-work .f-choice input:checked + span .f-choice-title { color: var(--teal-dark); }

.f-choice input:focus-visible + span {
  outline: 2px solid var(--teal-btn);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .f-choices { grid-template-columns: 1fr; }
  .f-choices .f-choice:last-child:nth-child(odd) { grid-column: auto; }
}

/* --- varianta se třemi kartami vedle sebe (styl jako výběr kategorie nahoře) --- */
.f-choices.f-choices-cards {
  grid-template-columns: repeat(3, 1fr);
}
.f-choices.f-choices-cards .f-choice:last-child:nth-child(odd) { grid-column: auto; }
.f-choices-cards .f-choice > span {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 14px;
}
.f-choices-cards .f-choice > span::before { display: none; }
.f-choice-title { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.f-choice-desc { font-weight: 500; font-size: 0.76rem; color: var(--ink-soft); line-height: 1.4; }

@media (max-width: 560px) {
  .f-choices.f-choices-cards { grid-template-columns: 1fr; }
}

.f-date-field { display: none; margin-top: 10px; }
.f-date-field.is-visible { display: block; }

.f-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.f-consent input { margin-top: 3px; }

.f-contact-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: -6px 0 14px;
}

.f-submit {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  color: var(--white);
  font-family: inherit;
}
.modal-box.theme-help .f-submit { background: var(--orange-btn); }
.modal-box.theme-help .f-submit:hover { background: var(--orange-hover); }
.modal-box.theme-work .f-submit { background: var(--teal-btn); }
.modal-box.theme-work .f-submit:hover { background: var(--teal-hover); }

.f-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.f-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: none;
}
.f-status.is-visible { display: block; }
.f-status.is-success { background: var(--mint-bg); color: var(--teal-dark); }
.f-status.is-error { background: #FCE8E6; color: #B3261E; }

/* --- výběr kategorie (úvodní obrazovka modalu poptávky/nabídky) --- */
.cat-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 6px;
}
.cat-switch[hidden] { display: none; }
.cat-switch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  padding: 20px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--peach-soft);
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.cat-switch-btn:hover { border-color: var(--teal-btn); transform: translateY(-2px); }
.cat-switch-title { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.cat-switch-desc { font-size: 0.76rem; color: var(--ink-soft); line-height: 1.4; }

.cat-switch-btn.is-active { border-width: 2px; padding: 19px 13px; }
.modal-box.theme-help .cat-switch-btn.is-active { border-color: var(--orange-btn); background: var(--peach-bg); }
.modal-box.theme-help .cat-switch-btn.is-active .cat-switch-title { color: var(--orange-hover); }
.modal-box.theme-work .cat-switch-btn.is-active { border-color: var(--teal-btn); background: var(--mint-bg); }
.modal-box.theme-work .cat-switch-btn.is-active .cat-switch-title { color: var(--teal-dark); }

@media (max-width: 560px) {
  .cat-switch { grid-template-columns: 1fr; }
}

/* --- tlačítko zpět na výběr kategorie --- */
.cat-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 18px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.cat-back:hover { color: var(--brown-dark); }
.cat-back svg { width: 16px; height: 16px; flex-shrink: 0; }

/* --- výzva napsat víc detailů --- */
.f-encourage {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--peach-bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 4px 0 14px;
  line-height: 1.5;
}
.f-encourage svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--orange-btn); }
.modal-box.theme-work .f-encourage { background: var(--mint-bg); }
.modal-box.theme-work .f-encourage svg { color: var(--teal-btn); }

/* --- nahrání fotky přetažením (drag & drop) --- */
.f-dropzone {
  position: relative;
  border: 1.5px dashed var(--peach-soft);
  border-radius: var(--radius-md);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  transition: all 0.15s ease;
}
.f-dropzone:hover,
.f-dropzone:focus-visible {
  border-color: var(--teal-btn);
  background: var(--peach-bg);
  outline: none;
}
.f-dropzone.is-dragover {
  border-color: var(--teal-btn);
  background: var(--mint-bg);
}

.f-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}
.f-dropzone-empty svg { width: 26px; height: 26px; color: var(--orange-btn); }
.modal-box.theme-work .f-dropzone-empty svg { color: var(--teal-btn); }
.f-dropzone-empty strong { color: var(--ink); }
.f-dropzone-hint { font-size: 0.76rem; color: var(--ink-soft); }

.f-dropzone-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.f-dropzone-preview[hidden] { display: none; }
.f-dropzone-empty[hidden] { display: none; }
.f-dropzone-preview img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.f-dropzone-preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.f-dropzone-preview-info span {
  font-size: 0.85rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.f-dropzone-remove {
  align-self: flex-start;
  background: none;
  border: none;
  color: #B3261E;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

/* --- login / "moje poptávky" modal --- */
.modal-box.theme-login .modal-eyebrow { color: var(--brown-soft); }
.login-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.login-switch button {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--peach-soft);
  background: var(--white);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.login-switch button.is-active {
  background: var(--brown-dark);
  border-color: var(--brown-dark);
  color: var(--white);
}

/* --- tlačítko ve stylu WhatsApp (zelená značky) --- */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-whatsapp:hover { background: #1EBE5D; }
.btn-whatsapp svg { flex-shrink: 0; }

/* --- validace: chybové stavy --- */
.f-error {
  color: #B3261E;
  font-size: 0.78rem;
  margin-top: 6px;
  display: none;
}
.f-group.has-error .f-error { display: block; }
.f-group.has-error .f-input,
.f-group.has-error .f-textarea,
.f-group.has-error .f-choice > span {
  border-color: #B3261E;
}
.f-group.has-error .f-label { color: #B3261E; }

/* --- konsent s odkazy na podmínky --- */
.f-consent a {
  color: var(--teal-dark);
  text-decoration: underline;
  font-weight: 600;
}
.f-consent a:hover { color: var(--teal-btn); }

/* --- dostupnost: rychlé volby + mřížka dny × denní doba --- */
.avail-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.avail-preset-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--peach-soft);
  background: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.avail-preset-btn:hover { border-color: var(--teal-btn); color: var(--teal-dark); }

.avail-grid {
  display: grid;
  grid-template-columns: 56px repeat(4, 1fr);
  gap: 5px;
  align-items: center;
}
.avail-grid .avail-head {
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-bottom: 4px;
}
.avail-grid .avail-day-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.avail-cell {
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--peach-soft);
  background: var(--white);
  cursor: pointer;
  transition: all 0.12s ease;
}
.avail-cell:hover { border-color: var(--teal-btn); }
.avail-cell.is-selected {
  background: var(--teal-btn);
  border-color: var(--teal-btn);
}
.modal-box.theme-help .avail-cell.is-selected {
  background: var(--orange-btn);
  border-color: var(--orange-btn);
}
.avail-hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; }

@media (max-width: 560px) {
  .avail-grid { grid-template-columns: 40px repeat(4, 1fr); gap: 4px; }
  .avail-grid .avail-head { font-size: 0.6rem; }
  .avail-cell { height: 28px; }
}

@media (max-width: 700px) {
  .f-row { flex-direction: column; }
  .modal-box { max-height: 92vh; }
  .modal-box-inner { padding: 28px 22px; }
}
