/* Authorize.Net Payment App - Mobile-first styles */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f3f5f8;
  color: #1a2230;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 14px 40px;
}
.hdr {
  text-align: center;
  padding: 18px 8px 8px;
}
.hdr h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hdr .brand-logo {
  display: block;
  max-width: 320px;
  width: 100%;
  height: auto;
  margin: 0 auto 6px;
}
.hdr .sub {
  margin: 4px 0 0;
  color: #6a7585;
  font-size: 14px;
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
.pill.warn { background: #ffe9b3; color: #7a4f00; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 1px 2px rgba(20,30,50,.05), 0 1px 8px rgba(20,30,50,.04);
}
.card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #2a3548;
}
.card h2.with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head h2 { margin: 0; }
.card-brands {
  display: flex;
  gap: 6px;
  align-items: center;
}
.card-brands img {
  height: 26px;
  width: auto;
  border: 1px solid #e2e7ee;
  border-radius: 5px;
  background: #fff;
  padding: 2px 4px;
  display: block;
}
.id-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 36px;
  flex-shrink: 0;
}
.id-icon svg { width: 100%; height: 100%; display: block; }

/* Bigger / bold Amount field */
.amount-label {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #1a2230 !important;
  margin-top: 14px !important;
}
.amount-input {
  font-size: 22px !important;
  font-weight: 700 !important;
  padding: 16px 14px !important;
  letter-spacing: 0.02em;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  margin: 10px 0;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="file"],
select {
  width: 100%;
  font-size: 16px;        /* 16px+ prevents iOS zoom on focus */
  padding: 12px 12px;
  margin-top: 6px;
  border: 1px solid #d3dae3;
  border-radius: 10px;
  background: #fafbfc;
  color: #1a2230;
  font-weight: 500;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23556' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
input:focus,
select:focus {
  outline: none;
  border-color: #0d6efd;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(13,110,253,.18);
}
input[type="file"] {
  padding: 10px;
  background: #fff;
}
.grid {
  display: grid;
  gap: 10px;
}
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 1fr 1fr 1fr; }
.g-state-zip { grid-template-columns: 130px 1fr; }
/* City | State | ZIP */
.g-csz { grid-template-columns: 1fr 90px 110px; }

/* Exp Month / Exp Year / CVV must stay on a single row at every width */
.g3 { grid-template-columns: 1fr 1fr 1fr !important; gap: 8px; }
.g3 select,
.g3 input {
  padding-left: 8px;
  padding-right: 24px;
  background-position: right 8px center;
}
.g3 input { padding-right: 8px; }

@media (max-width: 380px) {
  .g3 { gap: 6px; }
  .g3 select,
  .g3 input {
    font-size: 15px;
    padding-left: 6px;
    padding-right: 20px;
    background-position: right 6px center;
  }
  .g3 input { padding-right: 6px; }
  /* .keep grids always stay multi-column even on small phones */
  .g-state-zip { grid-template-columns: 110px 1fr; }
  .g-csz { grid-template-columns: 1fr 75px 90px; gap: 6px; }
}

.muted { color: #6a7585; font-size: 13px; }
.small { font-size: 12px; }
.center { text-align: center; }

.check {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-weight: 500;
  font-size: 15px;
  color: #2a3548;
  line-height: 1.45;
}
.check input {
  width: 22px; height: 22px;
  margin-top: 2px;
  accent-color: #0d6efd;
  flex-shrink: 0;
}
.big-check {
  font-size: 16px;
  font-weight: 600;
}
.big-check input {
  width: 32px;
  height: 32px;
  margin-top: 0;
  transform: scale(1);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .05s, background .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary {
  background: #0d6efd;
  color: #fff;
  box-shadow: 0 1px 3px rgba(13,110,253,.4);
}
.btn.primary:hover { background: #0b5ed7; }
.btn.primary:active { transform: scale(.99); }
.btn.ghost {
  background: #eef1f6;
  color: #2a3548;
}
.btn.ghost:hover { background: #e2e7ee; }
.btn.big {
  width: 100%;
  font-size: 17px;
  padding: 16px;
  margin-top: 8px;
}

/* DL preview */
.preview {
  margin-top: 10px;
  position: relative;
  background: #f7f9fc;
  border: 1px dashed #c8d1de;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}
.preview img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  display: block;
  margin: 0 auto 8px;
}

/* Signature */
.sig-wrap {
  position: relative;
  background: #fff;
  border: 2px dashed #c8d1de;
  border-radius: 10px;
  height: 220px;
  overflow: hidden;
  touch-action: none;
}
.sig-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}
.sig-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 10px;
}

/* Flash message */
.flash {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 500;
}
.flash.ok  { background: #d1f5dc; color: #11663b; }
.flash.err { background: #fde2e2; color: #8a1c1c; }

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(15,22,35,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 100;
  color: #fff;
  font-weight: 600;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result page */
.card.result {
  text-align: center;
  padding: 28px 20px;
}
.card.result .icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; color: #fff; margin: 0 auto 14px;
}
.card.result.good .icon { background: #18a957; }
.card.result.bad  .icon { background: #d6363b; }
.card.result h1 { margin: 0 0 6px; font-size: 22px; }
.card.result .big-msg { color: #4a5568; margin: 0 0 18px; font-size: 15px; }
.kv {
  text-align: left;
  background: #f7f9fc;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  font-size: 14px;
}
.kv dt { color: #6a7585; font-weight: 600; }
.kv dd { margin: 0; word-break: break-all; font-weight: 500; }
