/* ========== Reset / base ========== */
*{box-sizing:border-box; margin:0px;padding:0px}
html,body{height:100%}
body{
  margin:0;
  background:#f5f7fa;
  color:#1a202c;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:14px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.page{min-height:100vh;padding:40px 18px;display:flex;justify-content:center;align-items:flex-start}

/* ========== Card shell ========== */
.checkout-card{
  width:min(720px,100%);
  background:#fff;
  border:1px solid #e3e8ef;
  border-radius:14px;
  box-shadow:0 20px 45px -20px rgba(11,37,69,.18),0 2px 6px rgba(11,37,69,.04);
  overflow:hidden;
}

/* ========== Topbar ========== */
.topbar{
  height:84px;
  background:#0b2545;
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 28px;position:relative;
}
.topbar:after{
  content:"";position:absolute;left:0;right:0;bottom:-8px;height:16px;
  background:#ff8a1e;border-radius:50% 50% 0 0/100% 100% 0 0;
}
.logo{width:225px;max-height:52px;object-fit:contain;object-position:left center}
.secure-tag{
  display:inline-flex;align-items:center;gap:6px;
  font-size:11px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;
  color:#c9d9ee;background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  padding:6px 10px;border-radius:99px;
}

/* ========== Progress ========== */
.progress{display:flex;align-items:center;justify-content:center;gap:14px;padding:36px 24px 20px}
.progress-item{
  display:flex;align-items:center;gap:9px;
  color:#9aabbd;font-size:13px;font-weight:700;letter-spacing:.2px;transition:color .2s;
}
.progress-item.current,.progress-item.done{color:#0b2545}
.circle{
  width:28px;height:28px;border-radius:50%;
  border:2px solid #d6dee8;
  display:grid;place-items:center;
  background:#fff;color:#9aabbd;font-size:12.5px;font-weight:800;
  transition:all .2s;
}
.current .circle,.done .circle{background:#0b2545;border-color:#0b2545;color:#fff}
.line{height:2px;width:90px;background:#e3e8ef;border-radius:2px}

/* ========== Steps ========== */
.step{display:none;padding:4px 34px 34px}
.step.active{display:block}
h1{font-size:22px;color:#0b2545;margin:8px 0 6px;font-weight:800;letter-spacing:-.3px}
.intro{color:#64748b;margin:0 0 22px;font-size:14px}

/* ========== Panel ========== */
.panel{
  border:1px solid #e3e8ef;
  border-radius:12px;
  padding:22px;
  background:#fff;
  box-shadow:0 1px 2px rgba(11,37,69,.03);
}
.panel-title{
  font-size:11.5px;color:#0b2545;
  margin:0 0 12px;font-weight:800;
  letter-spacing:.7px;text-transform:uppercase;
}
em{font-style:normal;font-weight:400;color:#94a3b8;text-transform:none;letter-spacing:0}
hr{border:0;border-top:1px solid #eef2f7;margin:22px -22px}

/* ========== Card input stack ========== */
.card-stack{display:flex;flex-direction:column;gap:10px}
.input-row-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}

.input-box{
  position:relative;
  display:flex;align-items:center;
  border:1px solid #d6dee8;
  border-radius:8px;
  background:#fff;
  transition:border-color .12s ease, box-shadow .12s ease;
  min-height:52px;
}
.input-box:hover{border-color:#c1ccd9}
.input-box:focus-within{
  border-color:#0b2545;
  box-shadow:0 0 0 3px rgba(11,37,69,.10);
}
.input-box input{
  flex:1;min-width:0;
  border:0;outline:none;background:transparent;
  font-family:inherit;font-size:15px;color:#1a202c;
  padding:15px 14px;letter-spacing:.2px;line-height:1.2;
}
.input-box input::placeholder{color:#94a3b8;font-weight:400;letter-spacing:.1px}
.input-box input:-webkit-autofill{
  -webkit-box-shadow:0 0 0 1000px #fff inset;
  -webkit-text-fill-color:#1a202c;
}

/* Dynamic brand chip inside the card number field */
.brand-inside{
  display:inline-flex;align-items:center;justify-content:center;
  padding-right:14px;
  flex-shrink:0;
  min-width:0;
}
.brand-inside:empty{padding-right:0}
.brand-inside svg{
  height:24px;width:auto;max-width:56px;
  display:block;border-radius:3px;
}

.field-icon{width:30px;height:22px;color:#a0aec0;margin-right:14px;flex-shrink:0}

/* ========== Save-row checkbox ========== */
.save-row{
  display:flex;align-items:flex-start;gap:10px;
  margin-top:14px;font-size:13.5px;color:#4a5468;
  cursor:pointer;line-height:1.4;
}
.save-row input[type="checkbox"]{
  width:18px;height:18px;margin:1px 0 0;
  accent-color:#0b2545;flex:0 0 18px;cursor:pointer;
}

/* ========== Standard fields ========== */
.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid .span-2{grid-column:1 / -1}
label{font-size:12px;font-weight:700;color:#4a5468;display:block;letter-spacing:.2px}
input:not(.input-box input),select{
  display:block;width:100%;
  border:1px solid #d6dee8;border-radius:8px;
  padding:11px 12px;font-size:14px;font-family:inherit;
  background:#fff;color:#1a202c;
  transition:border-color .15s, box-shadow .15s;
  outline:none;margin-top:6px;
}
input:not(.input-box input):focus,select:focus{
  border-color:#0b2545;
  box-shadow:0 0 0 3px rgba(11,37,69,.10);
}
input[readonly]{background:#f8fafc;color:#64748b;cursor:default}
input[readonly]:focus{box-shadow:none;border-color:#d6dee8}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:14px}

/* ========== Order summary ========== */
.order-summary{
  background:#f8fafc;border:1px solid #e3e8ef;border-radius:10px;
  padding:14px 16px;margin-bottom:20px;
}
.order-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.order-row > div:first-child{display:flex;flex-direction:column;min-width:0}
.order-row strong{font-size:13.5px;color:#0b2545;font-weight:700}
.order-row span{font-size:12px;color:#64748b;margin-top:2px}
.order-price{font-weight:800;color:#0b2545;font-size:14px;white-space:nowrap}
.order-total{border-top:1px dashed #d6dee8;margin-top:12px;padding-top:12px}
.order-total .order-price{font-size:16px}

/* ========== Footer actions ========== */
.footer-actions{
  display:flex;justify-content:space-between;align-items:center;
  gap:18px;margin-top:22px;
}
.primary{
  border:0;border-radius:9px;
  background:#ff8a1e;color:#fff;
  font-weight:800;font-size:14px;
  padding:14px 22px;cursor:pointer;
  box-shadow:0 6px 14px -8px rgba(255,138,30,.6);
  transition:filter .15s, transform .05s;letter-spacing:.1px;
}
.primary:hover{filter:brightness(.96)}
.primary:active{transform:translateY(1px)}
.primary:disabled{opacity:.65;cursor:not-allowed;box-shadow:none}
.link-btn{
  border:0;background:none;color:#1261b0;font-weight:700;
  cursor:pointer;font-size:13.5px;padding:6px 2px;
}
.link-btn:hover{text-decoration:underline}

/* ========== Errors / notices ========== */
.error{color:#dc2626;font-size:12.5px;min-height:16px;margin-top:10px;font-weight:500}
.notice{
  background:#fff7e6;border:1px solid #ffd88a;color:#8a5300;
  border-radius:8px;padding:12px 14px;font-size:13px;margin-top:10px;font-weight:600;
}

/* ========== Trust bar ========== */
.trust-bar{
  display:grid;grid-template-columns:repeat(3,1fr);
  margin-top:18px;border:1px solid #e3e8ef;border-radius:10px;
  background:#f8fafc;overflow:hidden;
}
.trust-item{
  display:flex;align-items:center;gap:10px;
  padding:14px 16px;border-right:1px solid #e3e8ef;min-width:0;
}
.trust-item:last-child{border-right:0}
.trust-icon{width:24px;height:24px;flex:0 0 24px;color:#1261b0}
.trust-text{display:flex;flex-direction:column;min-width:0;gap:2px}
.trust-text strong{font-size:12px;color:#0b2545;font-weight:800;line-height:1.15;letter-spacing:.1px}
.trust-text span{font-size:11px;color:#64748b;line-height:1.25}

/* ========== Responsive ========== */
@media(max-width:640px){
  .page{padding:18px 12px}
  .step{padding:4px 20px 24px}
  .grid,.two-col,.input-row-2{grid-template-columns:1fr}
  .progress{padding:28px 12px 18px;gap:8px}
  .progress-item{font-size:11.5px}
  .line{width:32px}
  .topbar{padding:14px 18px;height:76px}
  .logo{width:180px}
  .secure-tag{display:none}
  .trust-bar{grid-template-columns:1fr}
  .trust-item{border-right:0;border-bottom:1px solid #e3e8ef}
  .trust-item:last-child{border-bottom:0}
  hr{margin:20px -20px}
  .panel{padding:18px}
  .panel-title{margin-bottom:10px}
}