.purchase-page,
.invoice-page,
.confirmation-page {
  background: #f8f3e9;
  color: #112c38;
}

.purchase-main,
.invoice-main,
.confirmation-main {
  width: min(100% - 3rem, 1180px);
  margin-inline: auto;
  padding-block: 4rem 6rem;
}

.purchase-heading {
  max-width: 900px;
  margin-bottom: 2.5rem;
}

.purchase-heading > p,
.order-summary > p,
.invoice-customer > p,
.confirmation-card > p:first-child {
  margin: 0 0 .65rem;
  color: #8d182f;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.purchase-heading h1,
.invoice-header h1,
.confirmation-card h1 {
  margin: 0 0 1rem;
  color: #3b0d18;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 1;
}

.purchase-heading > span {
  font-size: 1.06rem;
  line-height: 1.7;
}

.purchase-errors {
  margin-bottom: 2rem;
  padding: 1.25rem;
  border: 2px solid #b92727;
  background: #fff;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr);
  gap: 2rem;
  align-items: start;
}

.purchase-form {
  padding: 2.5rem;
  background: #062632;
  color: #fff;
}

.purchase-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.purchase-fields label {
  display: grid;
  gap: .55rem;
}

.purchase-fields label > span {
  color: #ffbf1f;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.purchase-fields input,
.purchase-fields textarea {
  width: 100%;
  border: 1px solid #526c78;
  border-radius: 0;
  background: #163542;
  color: #fff;
  padding: 1rem;
  font: inherit;
}

.purchase-fields textarea {
  min-height: 125px;
  resize: vertical;
}

.purchase-wide {
  grid-column: 1 / -1;
}

.ebook-option,
.terms-option {
  margin-top: 1.7rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.ebook-option {
  padding: 1.25rem;
  border: 1px dashed #708895;
}

.ebook-option input,
.terms-option input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.ebook-option span {
  display: grid;
  gap: .45rem;
}

.ebook-option strong {
  color: #ffbf1f;
}

.ebook-option small,
.ebook-option em {
  line-height: 1.55;
}

.ebook-unavailable {
  opacity: .66;
}

.purchase-submit {
  width: 100%;
  margin-top: 2rem;
  padding: 1.25rem;
  border: 0;
  background: #d92f2a;
  box-shadow: 9px 9px 0 #ffbf1f;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
}

.order-summary {
  position: sticky;
  top: 1.5rem;
  padding: 2rem;
  border: 1px solid rgba(59, 13, 24, .18);
  background: #fff;
}

.order-summary h2 {
  margin: 0 0 1.8rem;
  color: #3b0d18;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
}

.summary-line,
.summary-total,
.invoice-lines > div {
  padding-block: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid #ddd2c6;
}

.summary-total,
.invoice-total {
  font-size: 1.2rem;
}

.summary-note {
  margin-bottom: 0;
  line-height: 1.6;
}

.invoice-card,
.confirmation-card {
  max-width: 900px;
  margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 4rem);
  background: #fff;
  box-shadow: 0 24px 70px rgba(59, 13, 24, .12);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.invoice-header > div:last-child,
.invoice-customer {
  display: grid;
  gap: .35rem;
}

.invoice-customer {
  margin-block: 3rem;
}

.invoice-lines {
  margin-block: 2rem;
}

.invoice-actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.invoice-actions form {
  margin: 0;
}

.payment-paid {
  padding: 1rem 1.3rem;
  background: #dff4e3;
  color: #175d27;
  font-weight: 900;
}

.payment-pending-setup {
  max-width: 580px;
  padding: 1rem;
  border-left: 4px solid #d5a72b;
  background: #fff7d9;
  line-height: 1.6;
}

.confirmation-card {
  text-align: center;
}

.confirmation-card > p {
  line-height: 1.75;
}

.ebook-confirmed {
  margin-block: 2rem;
  padding: 1rem;
  background: #edf7ef;
}

@media (max-width: 850px) {
  .purchase-layout,
  .purchase-fields {
    grid-template-columns: 1fr;
  }

  .purchase-wide {
    grid-column: auto;
  }

  .order-summary {
    position: static;
  }
}

@media (max-width: 600px) {
  .purchase-main,
  .invoice-main,
  .confirmation-main {
    width: min(100% - 2rem, 1180px);
  }

  .purchase-form {
    padding: 1.4rem;
  }

  .invoice-header {
    flex-direction: column;
  }
}

/*
 * The optional eBook must appear in the order summary only
 * after the buyer explicitly selects the eBook checkbox.
 */
.summary-line[hidden],
[data-ebook-summary][hidden] {
  display: none !important;
}


/* FIRST BCI INVOICE ACTION BUTTONS */

.invoice-actions {
  align-items: stretch;
}

.invoice-payment-form {
  margin: 0;
  display: flex;
}

.invoice-action-button {
  min-height: 58px;
  padding: 1rem 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.invoice-payment-form .invoice-action-button {
  width: 100%;
}

.invoice-button-disabled,
.invoice-button-disabled:hover,
.invoice-button-disabled:focus {
  border-color: #b8ada1;
  background: #d7d0c8;
  box-shadow: none;
  color: #776e67;
  cursor: not-allowed;
  opacity: .78;
}

.invoice-card > .payment-pending-setup {
  margin-top: 1rem;
}

@media print {
  body.invoice-page {
    background: #fff;
  }

  .invoice-main {
    width: 100%;
    padding: 0;
  }

  .invoice-card {
    max-width: none;
    padding: 1.5rem;
    box-shadow: none;
  }

  .invoice-actions,
  .payment-pending-setup {
    display: none !important;
  }
}

@media (max-width: 700px) {
  .invoice-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .invoice-actions > *,
  .invoice-payment-form,
  .invoice-action-button {
    width: 100%;
  }
}


/* FIRST BCI STUDENT ACCOUNT */

.student-account-callout {
  margin-top: 2rem;
  padding: 2rem;
  border: 1px solid rgba(59, 13, 24, .14);
  background: #f5eee4;
  text-align: center;
}

.student-account-callout p {
  max-width: 780px;
  margin: 0 auto 1.4rem;
  line-height: 1.75;
}

.student-account-button {
  min-width: 280px;
  justify-content: center;
}

.student-login-page {
  min-height: 100vh;
  background: #f8f3e9;
}

.student-login-main {
  width: min(100% - 3rem, 900px);
  margin-inline: auto;
  padding-block: 5rem 7rem;
}

.student-login-card {
  padding: clamp(2rem, 6vw, 5rem);
  background: #fff;
  box-shadow: 0 28px 80px rgba(59, 13, 24, .12);
  text-align: center;
}

.student-login-card > p:first-child {
  margin: 0 0 .7rem;
  color: #8d182f;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.student-login-card h1 {
  margin: 0 0 1.5rem;
  color: #3b0d18;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 1;
}

.student-login-card p:not(:first-child) {
  max-width: 680px;
  margin: 0 auto 1.3rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.student-login-card .button {
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .student-account-button {
    width: 100%;
    min-width: 0;
  }

  .student-login-main {
    width: min(100% - 2rem, 900px);
    padding-block: 2rem 4rem;
  }
}
