:root{
  --bg:#f3f6f9;
  --card:#fff;
  --text:#2b2f33;
  --muted:#7a8794;
  --border:#cfd6dd;
  --blue1:#22b4ff;
  --blue2:#0b86ff;
  --danger:#e24b4b;
  --ok:#18c36b;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: system-ui, Arial, sans-serif;
  background:var(--bg);
  color: var(--text);
}

.page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px 16px;
}

.card{
  background:var(--card);
  width:620px;
  max-width:100%;
  border-radius:16px;
  box-shadow:0 18px 35px rgba(0,0,0,.1);
  padding:30px 40px;
}

.card__inner{
  max-width:420px;
  margin:auto;
}

.title{
  text-align:center;
  font-size:20px;
  font-weight:600;
  margin:0 0 18px;
}

.field{
  position:relative;
  margin-bottom:14px;
}

input, select{
  width:100%;
  height:46px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:0 14px;
  font-size:14px;
  background:#fff;
}

input:focus, select:focus{
  outline:none;
  border-color:#0b86ff;
  box-shadow: 0 0 0 3px rgba(11,134,255,.12);
}

.hint{
  display:none;
  font-size:12px;
  color:var(--danger);
  margin-top:6px;
}

.field.invalid .hint{display:block;}
.field.invalid input,
.field.invalid select{border-color:var(--danger);}

.row, .amountRow{
  display:flex;
  gap:14px;
}

.amountRow .field:first-child{flex:1.4}
.amountRow .field:last-child{flex:.6}
.row .field{flex:1}

.selectWrap{
  position:relative;
}

.chev{
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  width:14px;
  height:14px;
  color: rgba(43,47,51,.85);
  pointer-events:none;
}

.labelOver{
  position:absolute;
  top:-9px;
  left:10px;
  font-size:11px;
  background:#fff;
  padding:0 6px;
  color:var(--muted);
}

.iconBtn{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border-radius:10px;
  border:none;
  background:transparent;
  cursor:pointer;
  color:#111827;
  opacity:.78;
  display:flex;
  align-items:center;
  justify-content:center;
}
.iconBtn:hover{ opacity: .98; background: rgba(0,0,0,.03); }

/* Logos row */
.accepted-logos{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  margin:12px 0 18px;
  flex-wrap:wrap;
}

.accepted-logos .logo{
  display:block;
  width:auto;
  opacity:0.96;
  filter: saturate(1.05) contrast(1.06);
  user-select:none;
  -webkit-user-drag:none;
}
.accepted-logos .visa{ height: 26px; }
.accepted-logos .mastercard{ height: 24px; }
.accepted-logos .swift{ height: 22px; }
.accepted-logos .paypal{ height: 22px; }
.accepted-logos .logo:hover{ opacity:1; }

.pay{
  margin-top:10px;
  width:100%;
  height:52px;
  border:none;
  border-radius:12px;
  background:linear-gradient(var(--blue1), var(--blue2));
  font-weight:800;
  letter-spacing:.6px;
  box-shadow:0 10px 18px rgba(11,134,255,.18);
}
.pay span{color:white;}
.pay:disabled{opacity:.65;cursor:not-allowed;box-shadow:none;}

.footnote{
  text-align:center;
  font-size:12px;
  color:var(--muted);
  margin:10px 0 0;
}

/* ===== Confirmation page box ===== */
.confirmBox{
  background:#fff;
  border-radius:16px;
  box-shadow:0 18px 50px rgba(0,0,0,.18);
  padding:24px;
  text-align:center;
  position:relative;
  overflow:hidden;
}

.confirmTitle{
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.confirmText{
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.5;
}

/* Success icon */
.successIcon{
  width:52px;
  height:52px;
  margin: 2px auto 10px;
  display:none;
  color: var(--ok);
}
.successIcon.show{
  display:block;
  animation: pop .28s ease-out;
}
.successIcon svg{ width:52px; height:52px; display:block; }
@keyframes pop{
  from{ transform: scale(.78); opacity:.25; }
  to{ transform: scale(1); opacity:1; }
}

/* green vibe */
.confirmBox.successVibe::before{
  content:"";
  position:absolute;
  inset:-40px;
  background:
    radial-gradient(closest-side at 25% 15%, rgba(24,195,107,.22), rgba(24,195,107,0) 60%),
    radial-gradient(closest-side at 80% 35%, rgba(24,195,107,.14), rgba(24,195,107,0) 65%),
    radial-gradient(closest-side at 50% 110%, rgba(24,195,107,.10), rgba(24,195,107,0) 70%);
  pointer-events:none;
  z-index:0;
}
.confirmBox > *{ position: relative; z-index: 1; }

/* Close button */
.closeBtn{
  display:none;
  margin-top:14px;
  width:100%;
  height:44px;
  border-radius:10px;
  border:1px solid #ccc;
  background:#fff;
  font-weight:600;
  cursor:pointer;
}
.closeBtn.show{display:block;}

/* ===== CAPTCHA Trigger Button ===== */
.captcha-trigger-btn {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 6px;
}
.captcha-trigger-btn:hover {
  background: var(--bg);
  border-color: var(--blue1);
}
.captcha-trigger-btn.verified {
  background: rgba(24, 195, 107, 0.1);
  color: var(--ok);
  border-color: var(--ok);
  cursor: default;
}

/* ===== CAPTCHA Modal Overlay ===== */
.captcha-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.captcha-modal.show {
  opacity: 1;
  pointer-events: auto;
}
.captcha-modal-content {
  background: var(--card);
  width: 360px; /* Constrained for the image puzzle */
  max-width: 95%;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.captcha-modal.show .captcha-modal-content {
  transform: translateY(0);
}

.captcha-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.captcha-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.captcha-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.captcha-modal-close:hover {
  color: var(--danger);
}

/* ===== Image Puzzle CAPTCHA (Inside Modal) ===== */
.captcha-field { margin-bottom: 20px; }

.captcha-instruction { 
  font-size: 13px; 
  color: var(--muted); 
  margin-bottom: 12px; 
  text-align: center; 
  transition: color 0.3s;
}

.puzzle-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.puzzle-container {
  position: relative;
  width: 280px; 
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  background: #cfd6dd; /* fallback if image takes a second to load */
  box-shadow: inset 0 0 8px rgba(0,0,0,0.1);
  margin-bottom: 16px;
}

.puzzle-bg {
  position: absolute;
  inset: 0;
  background-size: 280px 150px;
  background-repeat: no-repeat;
}

/* The dark cutout hole */
.puzzle-hole {
  position: absolute;
  width: 45px;
  height: 45px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8);
  border-radius: 4px;
}

/* The sliding piece with the matched background */
.puzzle-piece {
  position: absolute;
  top: 0; left: 0;
  width: 45px;
  height: 45px;
  background-size: 280px 150px;
  background-repeat: no-repeat;
  box-shadow: 0 0 5px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.4);
  border-radius: 4px;
  z-index: 10;
}

/* The track below the puzzle */
.puzzle-slider-track {
  position: relative;
  width: 280px;
  height: 45px;
  background: #e9ecef;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
  user-select: none;
}

.puzzle-slider-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  background: rgba(11, 134, 255, 0.12);
  border-radius: 12px 0 0 12px;
}

.captcha-slider {
  position: absolute;
  top: 0; left: 0;
  width: 45px;
  height: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  color: var(--text);
  touch-action: none; 
  z-index: 2;
}
.captcha-slider:active { cursor: grabbing; }

/* Success State styling */
.puzzle-slider-track.verified {
  background: rgba(24, 195, 107, 0.1);
  border-color: var(--ok);
}
.puzzle-slider-track.verified .captcha-slider {
  background: var(--ok);
  color: #fff;
  border-color: var(--ok);
  cursor: default;
}
.puzzle-slider-track.verified .puzzle-slider-fill {
  background: rgba(24, 195, 107, 0.2);
}

@media (max-width:480px){
  .card{ padding:24px 16px; }
  .amountRow{ flex-direction:column; gap:10px; }
  .row{ flex-direction:column; gap:10px; }
}