/* ------------------------------------------------------------------
   Flywire design tokens (WPM-4258)
   Scoped to button colors for now; other tokens added by sibling tasks.
   ------------------------------------------------------------------ */
:root {
  --fw-blue-50: #F1F8FE;
  --fw-blue-600: #1274C4;
  --fw-blue-hover: #0F5795;
  --fw-blue-active: #0D4D84;
  --fw-blue-focus-rgb: 18, 116, 196;
  --fw-btn-border-radius: 4px;
  --fw-font-family: Rubik, "Open Sans", "Segoe UI", Tahoma, sans-serif;
  --fw-body-color: #1b2733;
}

/* ------------------------------------------------------------------
   Button overrides — Flywire primary style (WPM-4671)
   Overrides Bootstrap 5.3 .btn-primary CSS custom properties.
   ------------------------------------------------------------------ */
.btn-primary {
  --bs-btn-bg: var(--fw-blue-600);
  --bs-btn-border-color: var(--fw-blue-600);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--fw-blue-hover);
  --bs-btn-hover-border-color: var(--fw-blue-hover);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--fw-blue-active);
  --bs-btn-active-border-color: var(--fw-blue-active);
  --bs-btn-active-color: #fff;

  --bs-btn-disabled-bg: var(--fw-blue-600);
  --bs-btn-disabled-border-color: var(--fw-blue-600);
  --bs-btn-disabled-color: #fff;
  --bs-btn-focus-shadow-rgb: var(--fw-blue-focus-rgb);
  --bs-btn-border-radius: var(--fw-btn-border-radius);
}

.btn-outline-primary {
  --bs-btn-color: var(--fw-blue-600);
  --bs-btn-border-color: var(--fw-blue-600);
  --bs-btn-hover-bg: var(--fw-blue-hover);
  --bs-btn-hover-border-color: var(--fw-blue-hover);
  --bs-btn-active-bg: var(--fw-blue-active);
  --bs-btn-active-border-color: var(--fw-blue-active);
  --bs-btn-focus-shadow-rgb: var(--fw-blue-focus-rgb);
  --bs-btn-border-radius: var(--fw-btn-border-radius);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

  .btn-primary::after {
    content: url('../images/arrow-right.svg');
    display: block;
    line-height: 0;
    transition: transform 0.3s ease;
  }

  .btn-primary:hover::after {
    transform: translateX(0.4em);
  }

  .btn-primary:disabled::after,
  .btn-primary.disabled::after {
    transition: none;
  }

/* ------------------------------------------------------------------
   Typography — mirror Flywire PayEx (WPM-5228)
   Reference: paymentplatform/_applications/cdn/payment_gateway/includes/css/styles_v2.css
   ------------------------------------------------------------------ */
body {
  font-family: var(--fw-font-family);
  font-weight: 400;
  line-height: 1.4;
  color: var(--fw-body-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, .h1 {
  font-weight: 400;
}

.form-label, label {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--fw-body-color);
}

.btn {
  text-transform: capitalize;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.05;
}

.btn-primary {
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.btn-outline-primary {
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

/* Label alert — field-level validation feedback (mirrors PayEx .InputGroup-feedback--error) */
.invalid-feedback {
  font-size: 12px;
  font-weight: 500;
  color: #D63442;
}

/* Message alert — page/portal-level error banner (mirrors PayEx .Alert--danger) */
.alert-danger {
  font-size: 14px;
  color: var(--fw-body-color);
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(var(--fw-blue-focus-rgb), 0.5);
}

html {
  height: 100%;
}

body, importmap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

  body > .container,
  importmap > .container {
    flex: 1 0 auto;
  }

/* Footer layout */
.footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1rem 0;
  font-size: 0.8125rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-addressItem {
  color: var(--fw-body-color);
  font-size: 12px;
  display: block;
}

.footer-right {
  display: flex;
  align-items: center;
}

.footer-powered-by {
  text-align: start;
  flex-wrap: nowrap;
  flex-grow: 1;
  flex-shrink: 0;
  gap: 0.375rem;
  padding: 8px 8px 8px 24px;
  display: inline-flex;
}

.footer-flywire-logo {
  height: 1.25rem;
  width: auto;
  vertical-align: middle;
}

.footer-copyright {
  text-align: start;
  padding-top: 0;
  padding-bottom: 0;
  font-size: .75rem;
  line-height: 1.6;
  vertical-align: middle;
}

/* Flywire branding block is intentionally pinned to the trailing edge in both LTR and RTL. */
[dir="rtl"] .footer-right {
  align-items: flex-start;
  text-align: start;
  margin-left: 0;
  margin-right: auto;
}

.DefaultLogo.DefaultLogo--small {
  width: 48px;
}

.footer-addressItem,
.footer-copyright {
  margin: 0;
}

/* Portal action buttons (Select / Previous) — fixed size per Figma design */
.portal-row {
  font-size: 12px;
  color: #5A687B;
  margin: 0px 32px 8px 12px;
}

.portal-action-btn {
  font-size: 16px;
  height: 48px;
  width: 144px;
}

/* Portal Select button: show "Select" at rest, swap to "Pay" + arrow on hover */
.btn-primary.portal-action-btn .portal-btn-label-hover {
  display: none;
}

.btn-primary.portal-action-btn::after {
  display: none;
}

/* Hover swap only for direct-pay links, not the header button that opens a footer */
.btn-primary.portal-action-btn:not(.portal-header-btn):hover .portal-btn-label-default,
.btn-primary.portal-action-btn:not(.portal-header-btn):focus .portal-btn-label-default {
  display: none;
}

.btn-primary.portal-action-btn:not(.portal-header-btn):hover .portal-btn-label-hover,
.btn-primary.portal-action-btn:not(.portal-header-btn):focus .portal-btn-label-hover {
  display: inline;
}

.btn-primary.portal-action-btn:not(.portal-header-btn):hover::after,
.btn-primary.portal-action-btn:not(.portal-header-btn):focus::after {
  display: block;
}

/* Portal item rows */
.portal-item-row {
  border-color: var(--fw-blue-600) !important;
}

.cursor-pointer {
  cursor: pointer;
}

/* Channel custom content box (WPM-4896) */
.custom-content-box {
  background-color: var(--fw-blue-50);
  border: 1px solid var(--fw-blue-600);
}

/* Override Flywire CSS */
.custom-content-box p, .custom-content-box ol, .custom-content-box ul {
  color: #5a687b;
  font-size: 0.875rem;
  margin-top: 0;
  margin-bottom: 0.875rem;
}

@media (min-width: 992px) {
  .custom-content-box p, .custom-content-box ol, .custom-content-box ul {
    font-size: 1rem;
  }
}

.error-page {
  word-wrap: break-word;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: auto;
  max-width: 576px;
  margin: auto;
  padding: 0 24px 24px;
  display: flex;
  flex: 1 0 auto;
}

body:has(.error-page) > .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
@media (min-width: 576px) {
  .error-page {
    text-align: left;
    align-items: flex-start;
    padding: 32px 0;
  }
}

.Heading {
  font-weight: 700;
  line-height: 1.2;
  color: #1b2733;
  margin: 0 0 1rem;
}

.Heading--huge {
  font-size: 2rem;
}

@media (min-width: 576px) {
  .Heading--huge {
    font-size: 2.5rem;
  }
}

.ErrorPage-title {
  margin-bottom: 1.25rem;
}

.error-content {
  color: #495057;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

/* Header button when its panel is expanded — lock to "Pay" + arrow */
.btn-primary.portal-action-btn--expanded .portal-btn-label-default {
  display: none;
}

.btn-primary.portal-action-btn--expanded .portal-btn-label-hover {
  display: inline;
}

.btn-primary.portal-action-btn--expanded::after {
  display: block !important;
}

.connection-status--success {
  color: green;
}

.connection-status--failure {
  color: red;
}

.portal-item-amount::-webkit-inner-spin-button,
.portal-item-amount::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.portal-item-amount {
  -moz-appearance: textfield;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ------------------------------------------------------------------
   Language picker
   ------------------------------------------------------------------ */
.lang-picker-slot {
  margin-left: auto;
}

[dir="rtl"] .lang-picker-slot {
  margin-left: 0;
  margin-right: auto;
}

.lang-picker {
  position: relative;
  display: inline-block;
}

.lang-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: #212529;
  cursor: pointer;
  white-space: nowrap;
}

  .lang-picker__trigger:hover,
  .lang-picker__trigger:focus-visible {
    color: #495057;
    outline: 2px solid rgba(var(--fw-blue-focus-rgb), 0.5);
    outline-offset: 2px;
    border-radius: 4px;
  }

.lang-picker__globe {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.lang-picker__chevron {
  width: 0.625rem;
  height: 0.625rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.lang-picker[aria-expanded="true"] .lang-picker__chevron,
.lang-picker__trigger[aria-expanded="true"] .lang-picker__chevron {
  transform: rotate(180deg);
}

.lang-picker__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 1000;
  min-width: 14rem;
  margin: 0;
  padding: 0.75rem 0;
  list-style: none;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  outline: none;
}

  .lang-picker__menu:not([hidden]) {
    display: block;
  }

.lang-picker__option {
  display: block;
}

.lang-picker__option-btn {
  display: block;
  width: 100%;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  color: #212529;
  background: transparent;
  border: none;
  text-align: start;
  cursor: pointer;
}

  .lang-picker__option-btn:hover,
  .lang-picker__option[data-focused="true"] .lang-picker__option-btn {
    background: #f8f9fa;
  }

  .lang-picker__option-btn:focus-visible {
    outline: none;
  }

/* RTL: flip menu to left side */
[dir="rtl"] .lang-picker__menu {
  right: auto;
  left: 0;
}

[dir="rtl"] .lang-picker__option-btn {
  text-align: end;
}

@media (max-width: 575.98px) {
  .lang-picker__label,
  .lang-picker__chevron {
    display: none;
  }
}
