/* ============================================
   Transila iframe Creator — Design System
   Payment-grade aesthetic · RTL · Hebrew
   Inspired by Stripe / Paddle / Apple Pay
   ============================================ */

:root {
  /* Neutral / brand */
  --c-bg:       #f6f9fc;
  --c-bg-soft:  #eef3f9;
  --c-surface:  #ffffff;
  --c-surface-2:#f9fafd;
  --c-border:   #e3e8ee;
  --c-border-2: #d6dde6;
  --c-fg:       #0a2540;
  --c-fg-muted: #425466;
  --c-fg-soft:  #697386;
  --c-fg-dim:   #a5acba;

  /* Accent — refined indigo */
  --c-accent:        #635bff;
  --c-accent-600:    #5046e4;
  --c-accent-700:    #3d34c4;
  --c-accent-soft:   #ebe9ff;
  --c-accent-softer: #f4f3ff;

  /* Status */
  --c-success:    #1a7f5a;
  --c-success-bg: #ecfdf3;
  --c-danger:     #df1b41;
  --c-danger-bg:  #fef2f2;

  /* Radius */
  --r-sm: 8px;
  --r:    12px;
  --r-md: 16px;
  --r-lg: 22px;

  /* Shadows — subtle, layered */
  --sh-xs: 0 1px 2px rgba(10,37,64,.06);
  --sh-sm: 0 2px 5px rgba(10,37,64,.04), 0 1px 2px rgba(10,37,64,.06);
  --sh-md: 0 4px 14px rgba(10,37,64,.06), 0 2px 4px rgba(10,37,64,.04);
  --sh-lg: 0 24px 48px -12px rgba(10,37,64,.18), 0 8px 16px -8px rgba(10,37,64,.08);

  --font: "Heebo", "Assistant", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  direction: rtl;
  text-align: right;
}

body {
  background: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "tnum" 0, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3 {
  margin: 0 0 .35em;
  font-weight: 700;
  letter-spacing: -.012em;
  line-height: 1.22;
  color: var(--c-fg);
}
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }

/* ============================================
   BRAND BAR — refined, professional
   ============================================ */

.brand-bar {
  height: 72px;
  background: linear-gradient(180deg, #0a2540 0%, #0e2d4f 100%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.brand-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(99, 91, 255, .22), transparent 60%),
    radial-gradient(50% 80% at 100% 100%, rgba(99, 91, 255, .14), transparent 60%);
  pointer-events: none;
  z-index: -1;
}
.brand-bar::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 91, 255, .55), transparent);
}
.brand-bar__inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
}
.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .005em;
  user-select: none;
}
.brand-mark::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #635bff;
  box-shadow: 0 0 0 4px rgba(99,91,255,.18);
  transform: translateY(-2px);
}
.brand-mark em {
  font-style: normal;
  font-weight: 700;
  color: #b9b3ff;
  letter-spacing: .04em;
  font-size: 13px;
}

/* ============================================
   STAGES (page containers)
   ============================================ */

.payment-body, .admin-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(99, 91, 255, .05), transparent 70%),
    var(--c-bg);
}

.payment-stage {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.admin-stage {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============================================
   CARD shell
   ============================================ */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: card-in .42s cubic-bezier(.2, .8, .2, 1);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PAYMENT CARD
   ============================================ */

.payment-card {
  width: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: card-in .42s cubic-bezier(.2, .8, .2, 1);
}

.payment-card__head {
  padding: 26px 26px 22px;
  text-align: center;
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, var(--c-surface) 0%, var(--c-surface-2) 100%);
}
.lock-badge {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: var(--c-accent-soft);
  color: var(--c-accent-600);
  display: grid;
  place-items: center;
  border: 1px solid #dcd9ff;
}
.payment-card__head h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--c-fg-muted);
  letter-spacing: 0;
}
.payment-meta {
  font-size: 14px;
  color: var(--c-fg-soft);
}
.payment-meta .amount {
  display: block;
  margin-top: 6px;
  font-size: 32px;
  font-weight: 700;
  color: var(--c-fg);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.payment-meta .amount .currency {
  font-size: 18px;
  font-weight: 500;
  color: var(--c-fg-soft);
  margin-inline-start: 4px;
  vertical-align: top;
  position: relative;
  top: 6px;
}
.payment-meta .desc { display: block; }

.payment-card__body {
  padding: 8px 8px;
  background: var(--c-surface);
}
.payment-card__foot {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.trust-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--c-fg-soft);
  margin-bottom: 10px;
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.trust-item svg { color: var(--c-accent); }
.card-brands {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.card-brands span {
  display: inline-block;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-fg-soft);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  letter-spacing: .02em;
}

.legal-note {
  text-align: center;
  color: var(--c-fg-dim);
  font-size: 12px;
  max-width: 420px;
  line-height: 1.55;
  padding: 0 12px;
}

/* ============================================
   ADMIN CARD
   ============================================ */

.admin-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 32px 32px 28px;
  animation: card-in .42s cubic-bezier(.2, .8, .2, 1);
}
.admin-card .head {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-border);
}
.admin-card h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}
.admin-card .sub {
  color: var(--c-fg-soft);
  font-size: 14px;
}

/* Field grouping */
.section {
  margin-bottom: 22px;
}
.section + .section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--c-border);
}
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-fg-dim);
  margin-bottom: 12px;
}

.field {
  display: block;
  margin-bottom: 14px;
}
.field:last-child { margin-bottom: 0; }
.field > label,
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-fg);
  margin-bottom: 5px;
}
.field .hint {
  display: block;
  color: var(--c-fg-soft);
  font-size: 12px;
  margin-top: 5px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  height: 42px;
  font: inherit;
  font-size: 14px;
  padding: 0 12px;
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-fg);
  direction: rtl;
  text-align: right;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--c-fg-dim);
}
.field input:hover,
.field textarea:hover {
  border-color: #c5cfdc;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, .12);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Amount field — special styling */
.field-amount {
  position: relative;
}
.field-amount input {
  font-size: 18px;
  font-weight: 600;
  height: 52px;
  padding-inline-start: 40px;
  font-variant-numeric: tabular-nums;
}
.field-amount .currency-tag {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--c-fg-soft);
  font-size: 16px;
  font-weight: 500;
  margin-top: 11px;
}

/* ============================================
   VAT TOGGLE & BREAKDOWN
   ============================================ */

.vat-card {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.vat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.vat-toggle__text {
  display: flex;
  flex-direction: column;
}
.vat-toggle__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-fg);
}
.vat-toggle__sub {
  font-size: 12px;
  color: var(--c-fg-soft);
}
.vat-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  width: 38px;
  height: 22px;
  background: #cbd5e1;
  border-radius: 999px;
  flex-shrink: 0;
  transition: background .2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.vat-toggle input:checked ~ .switch {
  background: var(--c-accent);
}
.vat-toggle input:checked ~ .switch::after {
  transform: translateX(-16px);
}
.vat-toggle input:focus-visible ~ .switch {
  box-shadow: 0 0 0 3px rgba(99, 91, 255, .18);
}

.vat-breakdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--c-border-2);
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.vat-breakdown > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--c-fg-soft);
}
.vat-breakdown strong {
  color: var(--c-fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.vat-breakdown .total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--c-border);
  font-size: 14px;
}
.vat-breakdown .total span { font-weight: 600; color: var(--c-fg); }
.vat-breakdown .total strong {
  color: var(--c-accent-700);
  font-weight: 700;
  font-size: 16px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  height: 44px;
  border-radius: var(--r-sm);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
  user-select: none;
}
.btn-primary {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 1px 2px rgba(99,91,255,.45), var(--sh-xs);
}
.btn-primary:hover { background: var(--c-accent-600); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  background: #c4c0ff;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-ghost {
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  color: var(--c-fg);
}
.btn-ghost:hover { background: var(--c-surface-2); }
.btn-block { width: 100%; }
.btn-lg { height: 48px; font-size: 15px; }

/* ============================================
   RESULT (generated link)
   ============================================ */

.result-card {
  margin-top: 22px;
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, var(--c-accent-softer) 0%, var(--c-surface) 70%);
  border: 1px solid #dcd9ff;
  border-radius: var(--r);
  display: none;
}
.result-card.is-visible {
  display: block;
  animation: card-in .35s cubic-bezier(.2, .8, .2, 1);
}
.result-card .label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-accent-700);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.result-card .label::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-success);
}
.link-row {
  display: flex;
  gap: 8px;
}
.link-row input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12.5px;
  direction: ltr;
  text-align: left;
  padding: 0 12px;
  height: 40px;
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-fg);
}
.copy-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border-2);
  background: var(--c-surface);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--c-fg);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--c-surface-2); }
.copy-btn.is-copied {
  background: var(--c-success);
  color: #fff;
  border-color: var(--c-success);
}
.preview-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--c-accent-600);
  font-weight: 600;
  text-decoration: none;
}
.preview-link:hover { color: var(--c-accent-700); text-decoration: underline; }

/* ============================================
   STATUS PAGES
   ============================================ */

.status-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--c-bg);
  padding: 24px;
}
.status-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 44px 32px 36px;
  text-align: center;
  max-width: 460px;
  box-shadow: var(--sh-lg);
}
.status-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}
.status-success .status-icon { background: var(--c-success); }
.status-error .status-icon { background: var(--c-danger); }
.muted { color: var(--c-fg-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  .brand-bar { height: 60px; }
  .payment-stage, .admin-stage { padding: 24px 16px 40px; }
  .payment-card__head { padding: 22px 18px 18px; }
  .payment-card__foot { padding: 12px 14px 14px; }
  .admin-card { padding: 22px 20px; }
  .field-row { grid-template-columns: 1fr; }
  .trust-row { gap: 12px; font-size: 11px; }
  .payment-meta .amount { font-size: 28px; }
}
