/* ==============================
   Montonio Donate - Frontend CSS
   Scoped: .mdon
   Works with templates using:
   data-mdon-open / data-mdon-modal / data-mdon-close / data-mdon-pay etc.
   ============================== */

.mdon, .mdon * { box-sizing: border-box; }

.mdon {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: #1f2a30;
}

/* ---------- Simple utility classes (tailwind-ish) used in templates ---------- */

.mdon-flex { display: flex; }
.mdon-flex-1 { flex: 1 1 0%; }
.mdon-items-start { align-items: flex-start; }
.mdon-items-center { align-items: center; }
.mdon-justify-between { justify-content: space-between; }
.mdon-justify-end { justify-content: flex-end; }
.mdon-justify-center { justify-content: center; }
.mdon-gap-10 { gap: 2.5rem; }

.mdon-full { width: 100%; flex-basis: 100%; }

.mdon-p-10 { padding: 2.5rem; }
.mdon-mt-2 { margin-top: .5rem; }
.mdon-mt-3 { margin-top: .75rem; }
.mdon-mt-4 { margin-top: 1rem; }
.mdon-mt-8 { margin-top: 2rem; }

.mdon-text-sm { font-size: .875rem; }
.mdon-text-xs { font-size: .75rem; }

.mdon-uppercase { text-transform: uppercase; }
.mdon-tracking-wide { letter-spacing: .12em; }

.mdon-center { text-align: center; }
.mdon-muted { color: #6b7280; }

/* ---------- Card ---------- */

.mdon-card {
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.10);
  overflow: hidden; /* prevent "islenda" */
  flex-wrap: wrap;  /* prevent overlapping on smaller widths */
}

.mdon-rounded { border-radius: 28px; }
.mdon-shadow { box-shadow: 0 24px 60px rgba(0,0,0,.10); }
.mdon-bg-white { background: #fff; }

/* Left part */
.mdon-amount {
  margin-top: 10px;
  font-size: clamp(54px, 6vw, 76px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* Button */
.mdon-btn {
  border: 0;
  cursor: pointer;
  background: #1f2a30;
  color: #fff;
  border-radius: 999px;
  padding: 16px 28px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  white-space: nowrap;
}
.mdon-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0,0,0,.14); }
.mdon-btn:active { transform: translateY(0); box-shadow: none; }

/* Progress bar */
.mdon-bar {
  height: 14px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}
.mdon-bar-soft { height: 12px; }
.mdon-bar-fill {
  height: 100%;
  width: 0%;
  background: #2e5f78;
  border-radius: 999px;
}

/* Make donate card layout responsive */
@media (max-width: 920px) {
  .mdon-card.mdon-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  .mdon-flex.mdon-items-center.mdon-justify-end {
    width: 100%;
    justify-content: flex-start;
    margin-top: 12px;
  }
  .mdon-amount { font-size: clamp(44px, 9vw, 72px); }
}

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

/* modal wrapper uses [hidden] in template */
.mdon-modal[hidden] { display: none !important; }

.mdon-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: block;
}

/* backdrop */
.mdon-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

/* panel */
.mdon-modal-panel {
  position: relative;
  width: min(980px, calc(100% - 32px));
  margin: 70px auto 32px; /* popup nuleistas */
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.22);
  padding: 26px 28px 24px;
  overflow: hidden;
}

/* header */
.mdon-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.mdon-modal-title {
  font-size: 30px;
  font-weight: 700;
  margin: 0;
}

.mdon-x {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

/* ✅ amounts grid container (3 columns) */
.mdon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* If screen narrower, go to 2 columns earlier */
@media (max-width: 980px) {
  .mdon-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .mdon-modal-panel { margin: 56px auto 24px; padding: 20px 18px 18px; }
  .mdon-grid { grid-template-columns: repeat(2, 1fr); }
}

/* amount button generated by JS */
.mdon-amount-choice {
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 16px;
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.mdon-amount-choice:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.08); }
.mdon-amount-choice.is-active {
  border-color: #1f2a30;
  box-shadow: 0 0 0 3px rgba(31,42,48,.10);
}

/* Jei lieka paskutinis elementas vienas eilutėje (pvz. "Kita") – tegul išsiplečia gražiai */
.mdon-amount-choice:last-child:nth-child(3n + 1) {
  grid-column: span 1;
}

/* form rows */
.mdon-row { width: 100%; }
.mdon-label {
  display: block;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

.mdon-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) { .mdon-grid2 { grid-template-columns: 1fr; } }

.mdon-input {
  width: 100%;
  max-width: 100%;
  display: block;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 15px;
  outline: none;
  background: #fff;
}
.mdon-input:focus { border-color: #1f2a30; box-shadow: 0 0 0 3px rgba(31,42,48,.10); }

/* status / error text */
.mdon-status {
  font-size: 14px;
  color: #6b7280;
}
.mdon-status.is-error { color: #b42318; }

/* ✅ footer layout (text + button) */
.mdon-modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
  flex-wrap: wrap;
}
.mdon-modal-footer .mdon-hint {
  flex: 1 1 520px;
  min-width: 260px;
}

/* Smaller "APMOKĖTI" button */
.mdon-btn[data-mdon-pay] {
  padding: 14px 26px;
  font-size: 15px;
  height: 48px;
  min-width: 180px;
}

/* Avoid any theme overflow inside panel */
.mdon-modal-panel * { max-width: 100%; }


/* ==============================
   MDON Toast (success/cancel/error)
   ============================== */

.mdon-toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  transform: translateY(14px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  max-width: min(420px, calc(100% - 36px));
}
.mdon-toast.is-show{ transform: translateY(0); opacity: 1; }

.mdon-toast-inner{
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
  border: 1px solid #eef2f7;
  font-size: 14px;
}

.mdon-toast-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.mdon-toast-title{
  font-weight: 800;
  font-size: 15px;
}

.mdon-toast-x{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.mdon-toast-text{
  margin-top: 8px;
  color: #374151;
  line-height: 1.35;
}

.mdon-toast-success .mdon-toast-inner{ border-left: 6px solid #16a34a; }
.mdon-toast-cancel  .mdon-toast-inner{ border-left: 6px solid #f59e0b; }
.mdon-toast-error   .mdon-toast-inner{ border-left: 6px solid #dc2626; }