@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

@font-face {
  font-family: "TT Travels Next";
  src: url("./assets/fonts/TT Travels Next Trial 1-000/TT Travels Next Trial Regular.ttf")
    format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "TT Travels Next";
  src: url("./assets/fonts/TT Travels Next Trial 1-000/TT Travels Next Trial DemiBold.ttf")
    format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "TT Travels Next Bold";
  src: url("./assets/fonts/TT Travels Next Trial 1-000/TT Travels Next Trial Bold.ttf")
    format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg-total: #f5ca2f;
  --bg-container: #a554ad;
  --bg-panel: #ffffff;
  --text: #1e1e1e;
  --muted: #4b3950;
  --line: #fff;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Poppins", sans-serif;
  background: var(--bg-total);
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 2rem auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
  background: var(--bg-container);
  border: 0;
}

.hero {
  background: var(--bg-container);
  border: 0;
  padding: 1rem 1.2rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: "TT Travels Next Bold", "TT Travels Next", sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--bg-total);
  line-height: 1.1;
}

.hero p {
  margin: 0;
  color: #fff;
}

.hero p code {
  color: var(--bg-total);
  background: transparent;
}

.card {
  background: var(--bg-container);
  border: 0;
  padding: 1rem 1.2rem;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-family: "TT Travels Next Bold", "TT Travels Next", sans-serif;
  font-weight: 700;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: 0.02em;
  color: var(--bg-total);
}

.dropzone {
  border: 2px dashed var(--bg-total);
  min-height: 180px;
  padding: 1.2rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background-color 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  background: var(--bg-total);
}

.dropzone-title {
  font-family: "TT Travels Next", sans-serif;
  font-weight: 700;
}

.dropzone-subtitle {
  color: #fff;
  font-size: 0.92rem;
}

.info {
  margin-top: 0.8rem;
  padding: 0.6rem 0.8rem;
  border: 0;
  background: #fff;
  color: var(--muted);
  font-size: 0.94rem;
}

.hidden {
  display: none;
}

.message {
  min-height: 1.4rem;
  margin-top: 0.6rem;
  color: #fff;
  font-size: 0.92rem;
}

.message.error {
  color: var(--danger);
}

.form-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.dynamic-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.person-row {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.85rem;
}

.person-row-title {
  margin: 0 0 0.7rem;
  font-family: "TT Travels Next Bold", "TT Travels Next", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 0.8rem + 0.5vw, 1.25rem);
  color: var(--bg-total);
}

.person-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bg-total);
}

.field input {
  width: 100%;
  height: 2.35rem;
  border: 0;
  padding: 0 0.7rem;
  font-size: 0.95rem;
  font-family: "Poppins", sans-serif;
}

.field-input-wrap {
  position: relative;
}

.batch-form .field-input-wrap input {
  padding-right: 2.1rem;
}

.lock-icon-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.05rem;
  height: 1.05rem;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: var(--bg-container);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.lock-icon-btn:hover {
  color: #3f2245;
  background: transparent;
}

.field-input-wrap input:focus + .lock-icon-btn {
  background: transparent;
}

.lock-icon-btn:focus-visible {
  outline: 2px solid var(--bg-total);
  outline-offset: 2px;
}

.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lock-icon i {
  font-size: 0.9rem;
  line-height: 1;
}

.lock-icon-open {
  display: inline-block;
}

.lock-icon-closed {
  display: none;
}

.lock-icon-btn.is-locked .lock-icon-open {
  display: none;
}

.lock-icon-btn.is-locked .lock-icon-closed {
  display: inline-block;
}

.field input:disabled {
  background: #f3d8f6;
  color: #4b3950;
}

.field input:focus {
  border: 2px solid var(--bg-total);
  outline: 0;
  background: #fff4c8;
}

.button {
  margin-top: 0.9rem;
  border: 2px solid var(--bg-total);
  background: var(--bg-total);
  color: var(--bg-container);
  padding: 1rem 0.75rem 0.25rem 3rem;
  font-family: "TT Travels Next Bold", "TT Travels Next", sans-serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 0.55rem + 0.8vw, 1.3rem);
  line-height: 1.1;
  text-align: right;
  text-transform: uppercase;
  transition: background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.button-compact {
  margin-top: 0;
  padding: 0.75rem 0.65rem 0.25rem 1.7rem;
  font-size: clamp(0.8rem, 0.7rem + 0.35vw, 1rem);
}

.button-muted {
  background: transparent;
  color: var(--bg-total);
}

.button:hover:enabled {
  background: transparent;
  color: var(--bg-total);
  border-color: var(--bg-total);
}

.button-muted:hover:enabled {
  background: var(--bg-total);
  color: var(--bg-container);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-ghost {
  background: transparent;
  color: var(--bg-total);
}

.actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

#preview {
  width: 100%;
  height: 120px;
  min-height: 0;
  flex: none;
  max-height: 100%;
  border: 0;
  background: #fff;
}

.preview-resizer {
  width: 100%;
  height: 120px;
  min-height: 120px;
  max-height: 85vh;
  resize: vertical;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translate(-50%, 140%);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  min-width: min(560px, calc(100vw - 2rem));
  max-width: min(560px, calc(100vw - 2rem));
  padding: 1rem 1.1rem 0.35rem;
  border: 2px solid var(--bg-total);
  background: var(--bg-container);
  color: var(--bg-total);
  font-family: "TT Travels Next Bold", "TT Travels Next", sans-serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 0.75rem + 0.55vw, 1.2rem);
  line-height: 1.1;
  text-transform: uppercase;
  text-align: right;
  transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.25s ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast.error {
  border-color: var(--danger);
  color: #fff;
}

.rows-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.rows-modal.hidden {
  display: none;
}

.rows-modal-panel {
  width: min(1280px, calc(100vw - 2rem));
  background: var(--bg-container);
  border: 2px solid var(--bg-total);
  padding: 1rem 1.1rem;
  height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.batch-close-floating {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  z-index: 3;
}

.rows-modal-panel h3 {
  margin: 0 0 0.55rem;
  color: var(--bg-total);
  font-family: "TT Travels Next Bold", "TT Travels Next", sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.7rem);
  line-height: 1.1;
}

.rows-modal-panel p {
  margin: 0 0 0.8rem;
  color: #fff;
  font-size: 0.95rem;
}

.batch-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.batch-modal-head .button-compact {
  flex-shrink: 0;
}

.batch-modal-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
  margin-bottom: 0.9rem;
}

.batch-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 0.95rem;
  height: 100%;
  min-height: 0;
}

.batch-modal-left {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rows-modal-panel label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--bg-total);
  font-size: 0.88rem;
  font-weight: 600;
}

.rows-modal-input {
  width: 100%;
  height: 2.55rem;
  border: 2px solid var(--bg-total);
  padding: 0 0.7rem;
  font-size: 1rem;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: #fff;
}

.rows-modal-input:focus {
  outline: 0;
  background: #fff4c8;
}

.rows-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.batch-form {
  display: grid;
  gap: 0.9rem;
  align-content: start;
  overflow: auto;
  max-height: none;
  min-height: 0;
  flex: 1;
  padding-right: 0.2rem;
}

.batch-preview-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 0.85rem;
  overflow: hidden;
}

.batch-preview-stage {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.65rem;
}

.batch-preview-panel h4 {
  margin: 0;
  color: var(--bg-total);
  font-family: "TT Travels Next Bold", "TT Travels Next", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 0.83rem + 0.45vw, 1.25rem);
  line-height: 1.1;
}

.batch-preview-iframe {
  width: 100%;
  height: 120px;
  min-height: 0;
  flex: none;
  max-height: 100%;
  border: 0;
  background: #fff;
}

.batch-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  min-height: 0;
}

html.modal-open,
body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 1rem);
    margin: 1rem auto;
    padding: 0.7rem;
  }

  .card,
  .hero {
    padding: 0.8rem;
  }

  .rows-modal {
    padding: 0.6rem;
  }

  .rows-modal-panel {
    height: calc(100vh - 1.2rem);
  }

  .batch-modal-controls {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .batch-modal-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .batch-preview-wrap {
    min-height: 260px;
  }
}
