@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #f6f9fc;
  --white: #ffffff;
  --border: #e3e8ee;
  --txt: #1e1f21;
  --muted: #697386;
  --blue: #0a84ff;
  --green: #1ea672;
  --green-h: #168d63;
  --r: 8px;
  --w: 920px;
  --aside: 360px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  color: var(--txt);
}

body {
  background: var(--bg);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 10px;
}

.page {
  width: 100%;
  max-width: var(--w);
  display: flex;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

/* ──────── SUMMARY (left) ──────── */
.summary {
  flex: 0 0 var(--aside);
  padding: 32px 40px;
  border-right: 1px solid var(--border);
  position: relative;
  background: var(--white);
}

.summary header {
  position: relative;
  padding-bottom: 40px;
}

.back {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  color: var(--txt);
}

.logo {
  display: block;
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 16px;
  margin-top: 16px;
}

h1 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 22px;
}

.price {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 34px;
}

.price span {
  font-size: 14px;
  font-weight: 500;
  margin-left: 4px;
  color: var(--muted);
}

.line-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 10px 0;
}

.line-item small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.line-item.commission {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.line-item.total {
  font-weight: 600;
  margin-top: 26px;
}

.summary footer {
  position: absolute;
  bottom: 32px;
  left: 40px;
  font-size: 11px;
  color: var(--muted);
}

/* ──────── FORM (right) ──────── */
.panel {
  flex: 1;
  padding: 40px 48px;
  overflow-y: auto;
  background: var(--white);
}

.form label {
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 15px;
  background-color: var(--white);
}

input:focus, select:focus {
  outline: 2px solid var(--blue);
}

.row {
  display: flex;
  gap: 12px;
}

.row > * {
  flex: 1;
}

/* ──────── FIELDSETS ──────── */
form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 24px;
  padding: 16px 20px;
}

form fieldset legend {
  font-weight: 500;
  padding: 0 8px;
  margin-left: 8px;
  color: var(--txt);
  background: var(--white);
  font-size: 15px;
}

/* ──────── CHECKBOXES ──────── */
.checkbox-block {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 22px 0;
}

.checkbox-block input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--green);
  border-radius: var(--r);
}

.checkbox-block label {
  flex: 1;
  line-height: 1.4;
}

.checkbox-block span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.checkbox-block a {
  color: var(--blue);
}

/* ──────── PAY BUTTON ──────── */
.pay {
  width: 100%;
  padding: 14px 0;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pay:hover {
  background: var(--green-h);
}

.pay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ──────── CARD ICONS ──────── */
.input-group {
  position: relative;
}

.input-group input {
  padding-right: 180px;
}

.card-icons {
  position: absolute;
  top: 38%;
  right: 16px;
  transform: translateY(-50%);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.card-icons img {
  width: 32px;
  height: 20px;
  object-fit: contain;
  opacity: .35;
  filter: grayscale(1);
  transition: opacity .15s;
}

.card-icons img.active {
  opacity: 1;
  filter: none;
}

/* ──────── ERROR ──────── */
.error-message {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffe5e5;
  border: 1px solid #ffb3b3;
  color: #b30000;
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 16px;
  font-size: 14px;
}

.error-message i {
  font-style: normal;
  font-weight: bold;
}

.error-message-field {
  color: #e74c3c;
  font-size: 13px;
  margin: 2px 0 8px 2px;
  display: none;
}

.error-message-field.active {
  display: block;
}

.form .error {
  border: 1.5px solid #e74c3c !important;
  background: #fff6f6;
}

.hidden {
  display: none;
}

/* ──────── SPINNER ──────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.pay .spinner { display: none; }
.pay.loading .spinner { display: inline-block; }
.pay.loading .btn-text { opacity: 0.6; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ──────── MODALS ──────── */
.sms-modal-backdrop,
.threeds-modal-backdrop {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30,30,40,0.55);
  display: none;
  align-items: center;
  justify-content: center;
}

.global-spinner-backdrop {
  position: fixed;
  z-index: 900;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30,30,40,0.55);
  display: none;
  align-items: center;
  justify-content: center;
}

.push-modal-backdrop,
.result-modal-backdrop {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30,30,40,0.55);
  display: none;
  align-items: center;
  justify-content: center;
}

.sms-modal-backdrop.active,
.push-modal-backdrop.active,
.result-modal-backdrop.active,
.global-spinner-backdrop.active,
.threeds-modal-backdrop.active {
  display: flex;
}

.global-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid #e0e7ef;
  border-top: 5px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1.1s ease infinite;
  background: #fff;
  box-shadow: 0 2px 16px rgba(60,80,200,0.10);
}

.push-modal,
.result-modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 36px 32px 28px 32px;
  min-width: 340px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modalIn 0.3s ease 1;
  position: relative;
}

@keyframes modalIn {
  from { transform: translateY(40px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.push-modal .close-btn,
.result-modal .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5em;
  color: #888;
  cursor: pointer;
}

.push-icon,
.result-icon {
  font-size: 2.5em;
  margin-bottom: 12px;
  color: #3b82f6;
}

.push-modal h2,
.result-modal h2 {
  margin: 0 0 8px 0;
  font-size: 1.25em;
  font-weight: 700;
}

.push-modal p,
.result-modal p {
  color: #444;
  margin: 0 0 18px 0;
  font-size: 1.08em;
  text-align: center;
}

.result-modal .code-box {
  font-family: 'Fira Mono', 'Consolas', monospace;
  font-size: 1.3em;
  background: #f4f4f8;
  border-radius: 7px;
  padding: 10px 24px;
  margin: 10px 0 18px 0;
  letter-spacing: 0.15em;
}

.result-modal .result-actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.result-modal .result-btn {
  background: linear-gradient(90deg,#e0e7ef,#f3f4f6);
  color: #222;
  border: none;
  border-radius: 7px;
  font-size: 1.08em;
  font-weight: 600;
  padding: 10px 24px;
  cursor: pointer;
}

.result-modal .result-btn.danger {
  background: linear-gradient(90deg,#fca5a5,#f87171);
  color: #fff;
}

.result-modal .result-btn.primary {
  background: linear-gradient(90deg,#3b82f6,#6366f1);
  color: #fff;
}

/* ══════════════════════════════════════════════
   RESPONSIVE - MOBILE
   ══════════════════════════════════════════════ */
@media (max-width: 800px) {
  body {
    padding: 0;
  }

  .page {
    flex-direction: column;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .summary {
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 20px;
    text-align: center;
  }

  .summary header {
    padding-bottom: 16px;
  }

  .back {
    display: block;
    margin-bottom: 8px;
  }

  .logo {
    margin-top: 0;
  }

  .price {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .summary footer {
    position: static;
    margin-top: 16px;
  }

  .panel {
    padding: 24px 16px;
  }

  .input-group input {
    padding-right: 100px;
  }

  .card-icons img {
    width: 24px;
    height: 16px;
  }

  .row {
    flex-direction: column;
    gap: 0;
  }

  form fieldset {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .summary {
    padding: 16px 12px;
  }

  .panel {
    padding: 16px 12px;
  }

  .pay {
    font-size: 15px;
    padding: 12px 0;
  }

  .push-modal,
  .result-modal {
    min-width: auto;
    padding: 24px 16px;
    margin: 16px;
  }

  .result-modal .result-actions {
    flex-direction: column;
    width: 100%;
  }

  .result-modal .result-btn {
    width: 100%;
  }
}
