/* Bug report — globálny popup formulár (sticky tlačidlo + modal).
 *
 * Brand:
 *  - primary  #071532 (Ellavia hlboká navy)
 *  - accent   #ac8510 (zlatý akcent)
 *  - bg surface  #ffffff / #f4f5f7
 */

/* Sticky variant je vypnutý — bug report sa otvára z linku v päte (footer "Právne" sekcia)
 * cez ten istý `data-bug-report-open` selector. Tlačidlo necháme v DOM pre fallback /
 * voliteľnú aktiváciu cez `body.has-sticky-bugreport`. */
.bug-report-trigger {
  display: none;
}
.has-sticky-bugreport .bug-report-trigger {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9990;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 11px 16px 11px 13px;
  border: 1px solid rgba(7, 21, 50, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: #071532;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(7, 21, 50, 0.14), 0 1px 3px rgba(7, 21, 50, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, color 160ms ease, border-color 160ms ease;
}

.bug-report-trigger:hover,
.bug-report-trigger:focus-visible {
  color: #ac8510;
  border-color: rgba(172, 133, 16, 0.5);
  box-shadow: 0 10px 28px rgba(7, 21, 50, 0.18), 0 1px 3px rgba(7, 21, 50, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.bug-report-trigger:active {
  transform: translateY(0);
}

.bug-report-trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.bug-report-trigger__label {
  display: inline-block;
}

@media (max-width: 540px) {
  .bug-report-trigger {
    right: 12px;
    bottom: 12px;
    padding: 10px;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    justify-content: center;
  }
  .bug-report-trigger__label {
    /* na mobile len ikona, label v aria-label / title */
    position: absolute;
    left: -9999px;
    top: -9999px;
  }
}

/* ------------------------------------------------------------------ Modal */

.bug-report-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: bugReportFadeIn 180ms ease-out;
}

.bug-report-modal[hidden] {
  display: none;
}

@keyframes bugReportFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bug-report-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 21, 50, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
}

.bug-report-modal__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(7, 21, 50, 0.35), 0 4px 12px rgba(7, 21, 50, 0.18);
  font-family: inherit;
  color: #1f2540;
  animation: bugReportPanelIn 220ms cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

@keyframes bugReportPanelIn {
  from { transform: translateY(12px) scale(0.985); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.bug-report-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 12px;
}

.bug-report-modal__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #071532;
  letter-spacing: 0.1px;
}

.bug-report-modal__sub {
  margin: 0;
  font-size: 13px;
  color: #6b7290;
  line-height: 1.45;
}

.bug-report-modal__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(7, 21, 50, 0.1);
  background: #fafbfc;
  color: #6b7290;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.bug-report-modal__close:hover,
.bug-report-modal__close:focus-visible {
  background: #fff;
  color: #ac8510;
  border-color: rgba(172, 133, 16, 0.4);
  outline: none;
}

.bug-report-modal__form {
  padding: 4px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bug-report-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bug-report-modal__label {
  font-size: 13px;
  font-weight: 600;
  color: #2b3556;
}

.bug-report-modal__label em {
  color: #ac8510;
  font-style: normal;
  margin-left: 2px;
}

.bug-report-modal__form textarea,
.bug-report-modal__form input[type="text"],
.bug-report-modal__form input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  color: #1f2540;
  background: #fafbfc;
  border: 1px solid rgba(7, 21, 50, 0.14);
  border-radius: 10px;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
  box-sizing: border-box;
}

.bug-report-modal__form textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

.bug-report-modal__form textarea:focus,
.bug-report-modal__form input:focus {
  background: #fff;
  border-color: rgba(172, 133, 16, 0.7);
  box-shadow: 0 0 0 3px rgba(172, 133, 16, 0.14);
}

.bug-report-modal__form textarea:invalid:not(:placeholder-shown) {
  border-color: rgba(220, 38, 38, 0.5);
}

.bug-report-modal__hint {
  font-size: 11.5px;
  color: #93a0bd;
  align-self: flex-end;
}

.bug-report-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .bug-report-modal__row {
    grid-template-columns: 1fr;
  }
}

.bug-report-modal__honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.bug-report-modal__turnstile {
  width: 100%;
  max-width: 100%;
  margin: 4px 0 0;
  box-sizing: border-box;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(7, 21, 50, 0.15);
  background: #fff;
}
.bug-report-modal__turnstile .cf-turnstile {
  width: 100%;
  display: block;
  line-height: 0;
}
.bug-report-modal__turnstile .cf-turnstile iframe {
  display: block;
  width: 100% !important;
  border: 0;
}

.bug-report-modal__msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
}

.bug-report-modal__msg.is-error {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.bug-report-modal__msg.is-success {
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.bug-report-modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.bug-report-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms ease;
}

.bug-report-modal__btn--ghost {
  background: transparent;
  color: #6b7290;
  border-color: rgba(7, 21, 50, 0.16);
}

.bug-report-modal__btn--ghost:hover {
  color: #071532;
  border-color: rgba(7, 21, 50, 0.32);
  background: #fafbfc;
}

.bug-report-modal__btn--primary {
  background: #071532;
  color: #fff;
  border-color: #071532;
  box-shadow: 0 4px 14px rgba(7, 21, 50, 0.22);
}

.bug-report-modal__btn--primary:hover,
.bug-report-modal__btn--primary:focus-visible {
  background: #0c2848;
  border-color: #0c2848;
  outline: none;
}

.bug-report-modal__btn--primary:active {
  transform: translateY(1px);
}

.bug-report-modal__btn[disabled],
.bug-report-modal__btn[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

.bug-report-modal__contact {
  margin: 4px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: #6b7290;
  border-top: 1px solid #eef0f4;
  padding-top: 14px;
}

.bug-report-modal__contact a {
  color: #ac8510;
  text-decoration: none;
  font-weight: 600;
}

.bug-report-modal__contact a:hover {
  text-decoration: underline;
}

/* Body scroll lock keď je modal otvorený. */
body.bug-report-modal-open {
  overflow: hidden;
}

/* Mobile fullscreen */
@media (max-width: 480px) {
  .bug-report-modal {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .bug-report-modal__panel {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Tmavý mód (matchnutý s portal CSS, ak má prefers-color-scheme: dark) */
@media (prefers-color-scheme: dark) {
  .bug-report-trigger {
    background: #1a2244;
    color: #e8edff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
  }
  .bug-report-trigger:hover,
  .bug-report-trigger:focus-visible {
    color: #ffb778;
    border-color: rgba(172, 133, 16, 0.5);
  }
}
