* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #173040;
  background: linear-gradient(180deg, #eef8ff 0%, #ffffff 44%, #f7fbfe 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.payment-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.payment-top,
.payment-top nav,
.payment-brand,
.panel-head,
.field-row {
  display: flex;
  align-items: center;
}

.payment-top {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}

.payment-top nav {
  gap: 10px;
  flex-wrap: wrap;
}

.payment-top nav a {
  padding: 10px 14px;
  border: 1px solid #d8edf9;
  border-radius: 999px;
  background: #ffffff;
  color: #476475;
  font-size: 14px;
  font-weight: 800;
}

.payment-brand {
  gap: 10px;
  font-weight: 900;
  font-size: 18px;
}

.payment-brand img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}

.payment-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.payment-hero h1 {
  max-width: 680px;
  margin: 6px 0 12px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: .95;
  letter-spacing: 0;
}

.payment-hero p {
  max-width: 640px;
  margin: 0;
  color: #587282;
  font-size: 18px;
  line-height: 1.7;
}

.payment-eyebrow {
  margin: 0;
  color: #4fa8e9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.payment-summary,
.payment-panel {
  border: 1px solid #d9edf8;
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 24px 70px rgba(79, 168, 233, .14);
}

.payment-summary {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 28px;
}

.payment-summary span,
.payment-summary small,
.checkout-card span,
.payment-note {
  color: #648091;
}

.payment-summary strong {
  font-size: 34px;
  line-height: 1;
}

.payment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 20px;
  margin-bottom: 20px;
}

.payment-panel {
  padding: 24px;
}

.panel-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.panel-head span {
  padding: 8px 11px;
  border-radius: 999px;
  background: #eaf7ff;
  color: #267fbd;
  font-size: 12px;
  font-weight: 900;
}

.payment-form {
  display: grid;
  gap: 15px;
}

.payment-form label {
  display: grid;
  gap: 8px;
  color: #496779;
  font-size: 13px;
  font-weight: 900;
}

.payment-form input,
.payment-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #cfe8f7;
  border-radius: 14px;
  outline: none;
  background: #ffffff;
  color: #173040;
}

.payment-form input:focus,
.payment-form select:focus {
  border-color: #4fa8e9;
  box-shadow: 0 0 0 4px rgba(79, 168, 233, .14);
}

.field-row {
  gap: 14px;
}

.field-row label {
  flex: 1;
}

.payment-form button,
.success-button,
.history-panel button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: #4fa8e9;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.payment-form button:disabled,
.success-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.payment-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.checkout-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.checkout-card {
  display: grid;
  gap: 10px;
  min-height: 205px;
  padding: 18px;
  border: 1px dashed #bfe2f6;
  border-radius: 18px;
  background: #f7fcff;
}

.checkout-card strong {
  font-size: 24px;
}

.checkout-card dl,
.history-row dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 14px;
  margin: 0;
}

.checkout-card dt,
.history-row dt {
  color: #6f8795;
}

.checkout-card dd,
.history-row dd {
  margin: 0;
  font-weight: 800;
}

.success-button {
  background: #18a77a;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #f6fbff;
}

.history-row strong {
  display: block;
  margin-bottom: 8px;
}

.history-row em {
  align-self: start;
  padding: 8px 11px;
  border-radius: 999px;
  background: #ffffff;
  color: #267fbd;
  font-style: normal;
  font-weight: 900;
}

.payment-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  padding: 14px 16px;
  border-radius: 16px;
  background: #173040;
  color: #ffffff;
  box-shadow: 0 18px 45px rgba(23, 48, 64, .24);
  font-weight: 800;
}

.payment-toast[data-state="error"] {
  background: #b94141;
}

@media (max-width: 860px) {
  .payment-hero,
  .payment-grid {
    grid-template-columns: 1fr;
  }

  .payment-top,
  .field-row {
    align-items: stretch;
    flex-direction: column;
  }
}

.payment-eyebrow {
  letter-spacing: 0;
}

.checkout-hero,
.checkout-layout,
.checkout-trust,
.tutor-line,
.payment-methods label,
.order-total,
.order-card dl div,
.checkout-assurance {
  display: grid;
}

.checkout-hero {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
  margin: 18px 0;
}

.checkout-copy h1 {
  max-width: 580px;
  margin: 6px 0 10px;
  color: #142432;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.checkout-copy > p {
  max-width: 590px;
  margin: 0;
  color: #526575;
  font-size: 16px;
  line-height: 1.5;
}

.checkout-trust {
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: 10px;
  margin-top: 14px;
}

.checkout-trust span,
.checkout-assurance span {
  position: relative;
  min-height: 28px;
  padding-left: 22px;
  color: #405463;
  font-size: 13px;
  font-weight: 800;
}

.checkout-trust span::before,
.checkout-assurance span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22b07d;
  box-shadow: 0 0 0 4px rgba(34, 176, 125, .14);
}

.session-panel,
.checkout-panel {
  border: 1px solid #d7e2ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(20, 36, 50, .08);
}

.session-panel {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 148px;
  padding: 20px;
}

.session-panel span,
.session-panel small {
  color: #697988;
}

.session-panel strong {
  color: #142432;
  font-size: 24px;
  line-height: 1.05;
}

.checkout-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.checkout-panel {
  padding: 24px;
}

.checkout-form {
  display: grid;
  gap: 18px;
}

.checkout-form .panel-head,
.order-panel .panel-head {
  margin-bottom: 0;
}

.checkout-form h2,
.order-panel h2,
.history-panel h2 {
  margin: 4px 0 0;
  color: #142432;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.checkout-form .panel-head span,
.order-panel .panel-head span {
  border: 1px solid #dbe8f0;
  background: #f5f8fb;
  color: #405463;
}

.tutor-line {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e0e8ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.tutor-line img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.tutor-line strong {
  display: block;
  color: #142432;
  font-size: 16px;
}

.tutor-line span,
.payment-methods small,
.order-card dt,
.checkout-assurance {
  color: #697988;
}

.checkout-form label,
.payment-methods legend {
  color: #405463;
  font-size: 13px;
  font-weight: 900;
}

.checkout-form input,
.checkout-form select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #cad9e4;
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: #142432;
}

.checkout-form input:focus,
.checkout-form select:focus {
  border-color: #169ce5;
  box-shadow: 0 0 0 4px rgba(22, 156, 229, .14);
}

.payment-methods {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.payment-methods label {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  border: 1px solid #dbe4ec;
  border-radius: 8px;
  background: #ffffff;
}

.payment-methods input {
  width: 18px;
  height: 18px;
  accent-color: #169ce5;
}

.payment-methods b,
.payment-methods small {
  display: block;
}

.checkout-form button,
.pay-button,
.history-panel button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: #ff7a2f;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.checkout-form button:disabled,
.pay-button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.order-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
}

.order-card {
  display: grid;
  gap: 18px;
}

.order-total {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding-bottom: 16px;
  border-bottom: 1px solid #e3ebf1;
}

.order-total span {
  color: #697988;
  font-weight: 800;
}

.order-total strong {
  color: #142432;
  font-size: 36px;
  line-height: 1;
}

.order-card dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.order-card dl div {
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
}

.order-card dd {
  margin: 0;
  color: #142432;
  font-weight: 900;
}

.pay-button {
  background: #142432;
}

.checkout-assurance {
  gap: 6px;
  padding-top: 4px;
}

.history-panel {
  margin-bottom: 24px;
}

.history-list .order-empty {
  padding: 18px;
  border: 1px solid #e2ebf2;
  border-radius: 8px;
  background: #f8fbfd;
}

.history-row {
  border: 1px solid #e2ebf2;
  border-radius: 8px;
  background: #ffffff;
}

.payment-toast {
  border-radius: 8px;
}

@media (max-width: 900px) {
  .checkout-hero,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-trust {
    grid-template-columns: 1fr;
  }

  .order-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .payment-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 12px;
  }

  .checkout-copy h1 {
    font-size: 38px;
  }

  .field-row {
    flex-direction: column;
  }

  .order-card dl div,
  .order-total {
    grid-template-columns: 1fr;
  }
}
