/*
  TMBC.Application.StripePayment - structural styles shared by every application (vanilla CSS).

  Colour is expressed entirely through the --color-* custom properties below. The values here are
  fallbacks used by _Layout.Default.cshtml; each calling application's layout also loads its own
  stylesheet (elevate.css, registration.css, directpay.css) which redeclares them, and may restyle
  any element in this file. Nothing here should hard-code a brand colour.
*/
:root {
  --font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --color-primary: #528c9c;
  --color-secondary: #e15f3b;
  --color-secondary-hover: #c63006;
  --color-background: #ffffff;
  --color-surface: #fcfcfc;
  --color-text: #666666;
  --color-heading: #528c9c;
  --color-danger: #c63006;
  --color-progress-todo: #f0f0f0;
  --color-progress-done: #528c9c;
  --color-progress-active: #96b9c3;

  --gray-100: #fcfcfc;
  --gray-150: #f0f0f0;
  --gray-200: #eeeeee;
  --input-border: rgba(102, 102, 102, 0.4);
  --input-placeholder: #a8a8a8;
  --input-text: #4b505a;
  --radius: 4px;
  --container-max: 1070px;
}

*, *::before, *::after { box-sizing: border-box; }

html { margin: 0; padding: 0; height: 100%; }

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-background);
  overflow-y: scroll;
}

.body-container { position: relative; min-height: 100vh; padding-bottom: 150px; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 15px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a { color: var(--color-primary); }

/* ---------- header ---------- */
.site-header {
  background-color: var(--color-surface);
  box-shadow: 0 1px 8px 3px rgba(0, 0, 0, 0.1);
}

/* Single row: logo on the left, contact link right-aligned, both vertically centred. */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius);
}

.contact-link:hover { color: #2bbb9c; }

.contact-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: no-repeat center / 100% url(/img/cr-gray.svg);
}

.contact-link:hover .contact-icon { background-image: url(/img/cr-green.svg); }

.logo-link { display: inline-block; }
.logo-link img { width: 180px; display: block; }

/* ---------- page ---------- */
.page { padding-bottom: 40px; }

.page-title {
  font-weight: 300;
  font-size: 36px;
  margin: 20px 0 30px;
  color: var(--color-heading);
}

.panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: 1px 1px 18px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

@media (max-width: 575px) {
  .panel { padding: 15px; }
  .page-title { font-size: 28px; }
}

.section-heading {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--color-heading);
}

.amount-line { margin: 0 0 20px; font-size: 16px; }
.amount-label { text-transform: uppercase; font-size: 13px; font-weight: 700; margin-right: 6px; }
.amount-value { font-size: 18px; color: var(--color-heading); }

/* ---------- progress tracker ---------- */
.progressbar { margin-bottom: 20px; }

.checkout-progress {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  display: flex;
  align-items: stretch;
  list-style: none;
}

.checkout-progress li {
  position: relative;
  flex: 2;
  min-height: 60px;
  background-color: var(--color-progress-todo);
  text-align: center;
  font-size: 15px;
  line-height: 30px;
}

.checkout-progress li > div { color: rgba(102, 102, 102, 0.6); padding-left: 25px; }

.checkout-progress li > div::before,
.checkout-progress li > div::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border: 30px solid transparent;
  border-left-color: var(--color-progress-todo);
}

.checkout-progress li > div::after {
  top: -5px;
  border-width: 35px;
  border-left-color: var(--color-background);
  z-index: 1;
}

.checkout-progress li > div::before { z-index: 2; }

.checkout-progress li:first-child > div { padding-left: 0; }
.checkout-progress li:first-child > div::before,
.checkout-progress li:first-child > div::after { display: none; }

.checkout-progress p { margin: 0; height: 30px; }
.checkout-progress p:first-child { font-size: 15px; font-weight: 700; text-transform: uppercase; padding-top: 10px; line-height: 20px; }
.checkout-progress p:last-child { font-size: 14px; padding-bottom: 10px; margin-top: -5px; }

.checkout-progress li.done { background-color: var(--color-progress-done); }
.checkout-progress li.done > div { color: #fff; }
.checkout-progress li.done + li > div::before { border-left-color: var(--color-progress-done); }

.checkout-progress li.active { background-color: var(--color-progress-active); }
.checkout-progress li.active > div { color: #fff; }
.checkout-progress li.active + li > div::before { border-left-color: var(--color-progress-active); }

@media (max-width: 640px) {
  .checkout-progress li { flex: 1; border-left: 2px solid var(--color-background); }
  .checkout-progress li:first-child { border: none; }
  .checkout-progress li > div { padding: 0; }
  .checkout-progress li > div::before,
  .checkout-progress li > div::after { display: none; }
  .checkout-progress p { height: auto; line-height: 1.3; }
  .checkout-progress p:first-child { padding-top: 5px; font-size: 13px; }
  .checkout-progress p:last-child { font-size: 12px; margin-top: 0; padding: 0 6px 5px; }
}

/* ---------- forms ---------- */
.payment-form { max-width: 480px; }

.form-group { margin-bottom: 20px; }

label:not(.form-check-label) {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--input-text);
  background: #fff;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  outline: none;
  transition: box-shadow 0.15s ease-in-out;
}

.form-control::placeholder { color: var(--input-placeholder); }
.form-control:focus { box-shadow: 0 0 5px 0 rgba(102, 102, 102, 0.3); }
.form-control.is-invalid { border-color: var(--color-danger); }

.field-error { color: var(--color-danger); font-size: 13px; margin: 4px 0 0; }

.card-element { min-height: 90px; position: relative; }

.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.form-check-input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--color-primary); }
.form-check-label { font-size: 15px; user-select: none; }

/* ---------- errors ---------- */
.payment-error {
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 14px;
}
.payment-error ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- saved card ---------- */
.saved-card {
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.saved-card-heading { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; font-weight: 700; }
.saved-card p { margin: 0; }
.saved-card-summary { font-size: 18px; font-weight: 600; }
.saved-card-expiry, .saved-card-name { font-size: 14px; }

/* ---------- buttons ---------- */
.action-container {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 127px;
  padding: 10px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
  color: #fff;
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}
.btn-primary:hover { background-color: var(--color-secondary-hover); border-color: var(--color-secondary-hover); }
.btn-primary:focus-visible { outline: 3px solid rgba(0, 0, 0, 0.2); outline-offset: 2px; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-spinner { display: none; }
.btn.is-busy .btn-label { display: none; }
.btn.is-busy .btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loading-placeholder { display: flex; align-items: center; justify-content: center; min-height: 90px; }
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- footer ---------- */
.site-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  min-height: 90px;
  background-color: var(--color-surface);
  box-shadow: 0 -1px 8px 3px rgba(0, 0, 0, 0.1);
}

.site-footer section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 90px;
  gap: 16px;
}

.footer-logos a { display: flex; align-items: center; height: 35px; }
.footer-logos img:first-child { width: 150px; padding-right: 9px; border-right: 1px solid #bdbebf; margin-right: 9px; }
.footer-logos img:last-child { width: 21px; }

.footer-right { text-align: right; }
.footer-legal { font-size: 12px; color: #174f61; }

.footer-links {
  list-style: none;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 32px;
  padding: 0;
  margin: 12px 0 6px;
}
.footer-links a { color: var(--input-text); text-decoration: none; font-size: 15px; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .body-container { padding-bottom: 220px; }
  .site-footer section { flex-direction: column; justify-content: center; text-align: center; padding: 12px 0; }
  .footer-right { text-align: center; }
  .footer-links { justify-content: center; }
}
