/* ============================================================
   Flynext Voucher Generator — Styles
   Version: 5.0.0
   ============================================================ */

:root {
  --navy: #1b2147;
  --navy-deep: #11142e;
  --purple: #5b3a9e;
  --magenta: #e0117a;
  --grad: linear-gradient(135deg, var(--purple), var(--magenta));
  --cream: #faf8f4;
  --paper: #fffdfa;
  --ink: #20232b;
  --gray: #6b6f76;
  --line: #e7e3da;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

/* ---- TOP BAR ---- */
.flynext-app .topbar {
  background: var(--grad);
  color: #fff;
  padding: 14px 24px;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.flynext-app .topbar .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; opacity: .85; }
@media (max-width: 560px) {
  .flynext-app .topbar { padding: 12px 16px; }
  .flynext-app .topbar button { font-size: 12px !important; padding: 7px 10px !important; }
}

/* ---- LAYOUT ---- */
.flynext-app .layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  padding: 28px;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) {
  .flynext-app .layout { grid-template-columns: 1fr; padding: 16px; }
}

/* ---- FORM PANEL ---- */
.flynext-app .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  position: sticky;
  top: 20px;
}
@media (max-width: 900px) { .flynext-app .panel { position: static; } }

.flynext-app .panel h2 {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 16px;
  margin: 0 0 16px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.flynext-app .panel h2::before {
  content: '';
  width: 4px; height: 16px; border-radius: 2px;
  background: var(--grad);
  display: inline-block;
}
.flynext-app .panel h2.spaced { margin-top: 22px; }

.flynext-app .field { margin-bottom: 14px; }
.flynext-app .field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.flynext-app .field input,
.flynext-app .field select,
.flynext-app .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
}
.flynext-app .field textarea { resize: vertical; min-height: 54px; }
.flynext-app .field input:focus,
.flynext-app .field select:focus,
.flynext-app .field textarea:focus {
  outline: none;
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(224, 17, 122, .12);
}
.flynext-app .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- SEARCHABLE COUNTRY COMBOBOX ---- */
.flynext-app .combo { position: relative; }
.flynext-app .combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 15, 40, .14);
  z-index: 20;
  display: none;
}
.flynext-app .combo-list.open { display: block; }
.flynext-app .combo-option { padding: 8px 12px; font-size: 13.5px; cursor: pointer; }
.flynext-app .combo-option:hover,
.flynext-app .combo-option.active { background: #f5e9ef; color: var(--magenta); }
.flynext-app .combo-empty { padding: 8px 12px; font-size: 13px; color: var(--gray); font-style: italic; }

/* ---- ITEM ROWS ---- */
.flynext-app .item-row {
  display: grid;
  grid-template-columns: 1fr 110px 28px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: start;
}
.flynext-app .item-row input,
.flynext-app .item-row select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13.5px;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  width: 100%;
  background: #fff;
}
.flynext-app .item-row input:focus,
.flynext-app .item-row select:focus {
  outline: none;
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(224, 17, 122, .12);
}
.flynext-app .it-desc-custom { margin-top: 6px; }
.flynext-app .item-row .it-price { height: 37px; }
.flynext-app .item-remove {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  color: var(--gray);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}
.flynext-app .item-remove:hover { background: #f5e9ef; color: var(--magenta); border-color: var(--magenta); }

.flynext-app .add-item-btn {
  width: 100%;
  border: 1.5px dashed var(--line);
  background: #fcfaf6;
  border-radius: 8px;
  padding: 8px;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  margin-bottom: 14px;
}
.flynext-app .add-item-btn:hover { border-color: var(--magenta); color: var(--magenta); }

/* ---- SUMMARY LINES ---- */
.flynext-app .summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 6px 2px;
  color: var(--gray);
}
.flynext-app .summary-line b { color: var(--ink); }
.flynext-app .summary-line.balance {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
  font-size: 14.5px;
}
.flynext-app .summary-line.balance b {
  color: var(--magenta);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 16px;
}

/* ---- BUTTONS ---- */
.flynext-app .actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.flynext-app .btn {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 12px 14px;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.flynext-app .btn:active { transform: scale(.97); }
.flynext-app .btn-primary { background: var(--grad); color: #fff; }
.flynext-app .btn-primary:hover { opacity: .92; }
.flynext-app .btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.flynext-app .btn-ghost:hover { background: #f3f1ec; }
.flynext-app #pdfStatus { font-size: 12px; color: var(--gray); margin-top: 8px; min-height: 14px; }

/* ---- VOUCHER PREVIEW ---- */
.flynext-app .preview-wrap { display: flex; justify-content: center; }
.flynext-app #bon {
  width: 740px;
  max-width: 100%;
  background: var(--paper);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(20, 15, 40, .12);
}
.flynext-app .bon-topline { height: 6px; background: var(--grad); }
.flynext-app .bon-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 32px 18px;
  gap: 18px;
}
.flynext-app .bon-brand { display: flex; align-items: center; gap: 14px; }
.flynext-app .bon-brand img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.flynext-app .bon-brand .name { font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif; font-weight: 700; font-size: 20px; color: var(--navy); }
.flynext-app .bon-brand .tag { font-size: 11px; color: var(--gray); font-style: italic; margin-top: 2px; }
.flynext-app .bon-brand .addr { font-size: 10.5px; color: var(--gray); margin-top: 3px; }

.flynext-app .bon-badge {
  width: 84px; height: 84px; border-radius: 50%;
  border: 3px solid transparent;
  background-image: var(--grad);
  background-origin: border-box;
  background-clip: border-box;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.flynext-app .bon-badge-inner {
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.flynext-app .bon-badge-inner .lbl { font-size: 8px; letter-spacing: .08em; color: var(--gray); font-weight: 600; }
.flynext-app .bon-badge-inner .num { font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif; font-weight: 700; font-size: 12px; color: var(--navy); line-height: 1.2; text-align: center; }

.flynext-app .bon-divider { height: 1px; background: var(--line); margin: 0 32px; }

.flynext-app .bon-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  padding: 16px 32px 0; gap: 6px 16px;
  font-size: 12px; color: var(--gray);
}

.flynext-app .bon-body { padding: 18px 32px 8px; }
.flynext-app .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.flynext-app .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.flynext-app .info-block .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); font-weight: 600; margin-bottom: 3px; }
.flynext-app .info-block .v { font-size: 15px; color: var(--ink); font-weight: 600; }

.flynext-app .service-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fcfaf6;
  margin-bottom: 18px;
}
.flynext-app .service-box .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); font-weight: 600; margin-bottom: 6px; }
.flynext-app .service-box .v-main { font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif; font-weight: 600; font-size: 15px; color: var(--navy); margin-bottom: 4px; }
.flynext-app .service-box .v-country { font-size: 13px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.flynext-app .service-box .v-date { font-size: 13px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.flynext-app .service-box .v-sub { font-size: 13px; color: var(--ink); line-height: 1.5; white-space: pre-wrap; }

.flynext-app .section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray); font-weight: 700; margin-bottom: 8px;
}

.flynext-app table.price { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.flynext-app table.price td { padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.flynext-app table.price td.lbl { color: var(--ink); }
.flynext-app table.price td.val { text-align: right; font-weight: 600; white-space: nowrap; }
.flynext-app table.price tr.sum td { border-bottom: none; }
.flynext-app table.price tr.sum td.lbl,
.flynext-app table.price tr.sum td.val { padding-top: 10px; font-weight: 600; }
.flynext-app table.price tr.total td { border-bottom: none; }
.flynext-app table.price tr.total td.lbl,
.flynext-app table.price tr.total td.val {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  padding-top: 12px;
}
.flynext-app table.price tr.total td.val {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.flynext-app .pay-mode { font-size: 13px; color: var(--gray); margin: 10px 0 14px; }
.flynext-app .pay-mode b { color: var(--ink); }
.flynext-app .notes { font-size: 12.5px; color: var(--gray); line-height: 1.5; margin-bottom: 6px; }

.flynext-app .sign-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  padding: 18px 32px 26px;
}
.flynext-app .sign-box { border-top: 1px dashed var(--line); padding-top: 8px; font-size: 11px; color: var(--gray); text-align: center; }

/* ---- FOOTER ---- */
.flynext-app .bon-footer { background: var(--navy-deep); color: #cfd2e6; padding: 0; }
.flynext-app .bon-footer-inner { display: flex; align-items: center; padding: 20px 28px; gap: 0; }
.flynext-app .bon-footer-contacts { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.flynext-app .bon-footer-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #adb1c8; }
.flynext-app .fi-icon { font-size: 12px; flex-shrink: 0; width: 18px; text-align: center; }
.flynext-app .bon-footer-item b { color: #e8eaf3; font-weight: 600; }
.flynext-app .bon-footer-divider { width: 1px; align-self: stretch; background: rgba(255, 255, 255, .1); margin: 0 24px; flex-shrink: 0; }
.flynext-app .bon-footer-qr { display: flex; flex-direction: column; align-items: center; gap: 7px; flex-shrink: 0; }
.flynext-app .bon-footer-qr img { width: 86px; height: 86px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .15); display: block; box-shadow: 0 4px 18px rgba(0, 0, 0, .4); }
.flynext-app .bon-footer-qr-label { font-size: 10.5px; color: #e8eaf3; font-weight: 600; font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif; }
.flynext-app .bon-footer-qr-sub { font-size: 9px; color: #6b6f88; }

.flynext-app .hidden-empty { color: #b9bcc3; font-style: italic; }

/* ---- REFUND POLICY ---- */
.flynext-app .refund-policy-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  background: #f7f5ff;
  margin-bottom: 14px;
  direction: rtl;
  text-align: right;
}
.flynext-app .refund-policy-box .k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--purple);
  font-weight: 700;
  margin-bottom: 6px;
  direction: ltr;
  text-align: left;
}
.flynext-app .refund-policy-box ul { margin: 0; padding: 0 18px 0 0; list-style: disc; }
.flynext-app .refund-policy-box ul li { font-size: 11px; color: var(--gray); line-height: 1.65; margin-bottom: 2px; }

/* ---- RESPONSIVE VOUCHER ---- */
.flynext-app #bon.compact .bon-head { padding: 20px 18px 14px; gap: 12px; flex-wrap: wrap; }
.flynext-app #bon.compact .bon-brand { flex: 1 1 auto; }
.flynext-app #bon.compact .bon-brand img { width: 48px; height: 48px; }
.flynext-app #bon.compact .bon-brand .name { font-size: 16px; }
.flynext-app #bon.compact .bon-brand .tag { font-size: 9px; }
.flynext-app #bon.compact .bon-brand .addr { font-size: 8.5px; }
.flynext-app #bon.compact .bon-badge { width: 64px; height: 64px; margin-left: auto; }
.flynext-app #bon.compact .bon-badge-inner { width: 58px; height: 58px; }
.flynext-app #bon.compact .bon-badge-inner .num { font-size: 10px; }
.flynext-app #bon.compact .bon-badge-inner .lbl { font-size: 7px; }
.flynext-app #bon.compact .bon-meta { padding: 14px 18px 0; font-size: 10.5px; }
.flynext-app #bon.compact .bon-body { padding: 16px 18px 6px; }
.flynext-app #bon.compact .grid2 { gap: 12px; }
.flynext-app #bon.compact .info-block .v { font-size: 13.5px; }
.flynext-app #bon.compact .service-box { padding: 12px 14px; }
.flynext-app #bon.compact .service-box .v-country { font-size: 12px; }
.flynext-app #bon.compact .service-box .v-date { font-size: 12px; }
.flynext-app #bon.compact table.price td { font-size: 12.5px; padding: 7px 0; }
.flynext-app #bon.compact table.price tr.total td.lbl,
.flynext-app #bon.compact table.price tr.total td.val { font-size: 15px; padding-top: 10px; }
.flynext-app #bon.compact .pay-mode { font-size: 12px; }
.flynext-app #bon.compact .sign-row { padding: 14px 18px 20px; gap: 12px; }
.flynext-app #bon.compact .sign-box { font-size: 10px; }
.flynext-app #bon.compact .bon-footer { padding: 14px 18px; font-size: 10px; gap: 8px 12px; }

.flynext-app #bon.compact-sm .bon-head { flex-direction: column; align-items: flex-start; }
.flynext-app #bon.compact-sm .bon-badge { margin-left: 0; align-self: flex-end; margin-top: -46px; }

@media (max-width: 420px) {
  .flynext-app .item-row {
    grid-template-columns: 1fr 28px;
    grid-template-areas: "desc desc" "price remove";
    row-gap: 6px;
  }
  .flynext-app .item-row .it-desc-wrap { grid-area: desc; }
  .flynext-app .item-row .it-price { grid-area: price; }
  .flynext-app .item-row .item-remove { grid-area: remove; }
}

/* ---- PRINT ---- */
@media print {
  .flynext-app .topbar,
  .flynext-app .panel,
  .flynext-app #pdfStatus { display: none !important; }
  body { background: #fff; margin: 0; padding: 0; }
  .flynext-app .layout { display: block; padding: 0; max-width: none; }
  .flynext-app .preview-wrap { display: block; }
  .flynext-app #bon {
    box-shadow: none;
    margin: 0 auto;
    width: 100% !important;
    max-width: 100% !important;
  }
  @page { margin: 0; size: A4 portrait; }
  .flynext-app table.price tr.total td.val {
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    background-image: none !important;
    background-color: transparent !important;
    -webkit-text-fill-color: #e0117a !important;
    color: #e0117a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}
