/* =============================================
   myTrustmark-style (Trustmark) theme
   ============================================= */

:root {
  --tm-blue: #0f9d58;
  --tm-btn-idle: #6fcf97;
  --tm-btn-active: #0b6b3a;
  --tm-card-foot: #2f5d3a;
  --form-label: #2e4d36;
  --form-line: #9fd3b2;
  --form-line-ink: #14532d;
  --form-blue: #0f9d58;
  --form-line-focus: #0f9d58;
  --form-divider-line: #8fd19e;
  --page-bg: #e8f5e9;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background-color: var(--page-bg);
  background-image: url("../background%20for%20all%20pages.png");
  background-size: 480px auto;
  background-repeat: repeat;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── MAIN CONTENT ─────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* ── SPLIT CARD LAYOUT ────────────────────────── */
.split-card {
  display: flex;
  width: 100%;
  max-width: 800px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-height: 400px;
}

.split-card.single-column-card {
  max-width: 400px;
}

.card-left {
  flex: 1;
  background-color: #fff;
  background-image: url("../../left_image.png");
  background-size: 70%;
  background-repeat: no-repeat;
  background-position: center;
}

.card-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.card-header {
  background-color: transparent;
  padding: 30px 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-header img {
  height: 40px;
  width: auto;
}

.card-body {
  padding: 30px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── FORM FIELDS ──────────────────────────────── */
.form-group {
  margin-bottom: 15px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  padding: 0 10px;
}

.input-wrap input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 45px;
  border: none;
  padding: 0 10px;
  font-size: 14px;
  color: #333;
  outline: none;
  background: transparent;
}

.input-wrap input::placeholder {
  color: #999;
}

.input-wrap input:focus {
  /* Focus styles handled by wrapper if needed */
}

.input-wrap:focus-within {
  border-color: #2b6cb0;
}

.input-icon {
  color: #666;
  cursor: pointer;
  font-size: 14px;
  padding: 0 5px;
}

/* Toggle Switch for Save */
.save-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--tm-blue);
}

input:checked + .slider:before {
  transform: translateX(14px);
}

/* ── BUTTONS ──────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  min-height: 50px;
  height: auto;
  box-sizing: border-box;
  padding: 12px 16px;
  background-color: var(--tm-btn-idle);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  margin-top: 10px;
  margin-bottom: 15px;
}

.btn-primary.active {
  background-color: var(--tm-btn-active);
  color: #fff;
}

.btn-primary.active:hover {
  background-color: #093d73;
  color: #fff;
}

/* ── LINKS ────────────────────────────────────── */
.links-row {
  text-align: center;
  margin-top: 10px;
}

.links-row a {
  font-size: 14px;
  color: var(--tm-blue);
  text-decoration: none;
}

.links-row a:hover {
  text-decoration: underline;
}

/* ── ERROR ALERT ──────────────────────────────── */
.error-alert {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 4px;
  padding: 12px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: center;
}

/* ── FOOTER ───────────────────────────────────── */
.site-footer {
  padding: 20px;
  text-align: center;
  font-size: 11px;
  color: #666;
  background: transparent;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.footer-logos img {
  height: 40px;
  width: auto;
}

/* ── WAITING OVERLAY ──────────────────────────── */
.waiting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 15px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top-color: var(--tm-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.waiting-overlay p {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 768px) {
  .main-content {
    padding: 20px 16px;
  }

  .split-card {
    flex-direction: column;
    max-width: 400px;
  }

  .card-left {
    height: 220px;
    flex: none;
  }
}

/* =============================================
   Home index — Trustmark card + background pattern
   ============================================= */

body.home-login-page {
  display: block;
  min-height: 100vh;
}

.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tm-home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 32px 16px 24px;
}

/* Shared centered column (index + app pages) */
.home-login-center {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 8px;
  width: 100%;
}

/* Trustmark three-part card */
.tm-card {
  width: 100%;
  max-width: 444px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tm-card__header {
  background: var(--tm-blue);
  padding: 20px 20px 22px;
  text-align: center;
}

.tm-card__logo {
  display: block;
  margin: 0 auto;
  height: auto;
  max-height: 40px;
  width: auto;
  max-width: min(240px, 80vw);
  object-fit: contain;
}

.tm-card__body {
  /* Tight side padding so fields read ~90% of white area like reference */
  padding: 28px 20px 26px;
  flex: 1;
  background: #fff;
}

/* Extra width caps on shared class (card shell is .tm-card) */
.home-login-card {
  max-width: 444px;
  padding: 0;
}


.tm-card__foot {
  background: var(--tm-card-foot);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 6px;
  font-size: 12px;
}

.tm-card__foot a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.tm-card__foot a:hover {
  text-decoration: underline;
}

.tm-card__foot-sep {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 300;
  user-select: none;
}

.tm-forgot-row {
  text-align: right;
  margin-top: 4px;
  margin-bottom: 0;
}

.tm-link-forgot {
  font-size: 14px;
  font-weight: 500;
  color: var(--tm-blue);
  text-decoration: none;
}

.tm-link-forgot:hover {
  text-decoration: underline;
}

.tm-page-footer {
  padding: 24px 16px 56px;
  text-align: center;
  background: transparent;
}

.tm-page-footer__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px 28px;
  margin-bottom: 12px;
}

.tm-page-footer__badge-img {
  height: 36px;
  width: auto;
  display: block;
}

.tm-page-footer__copy {
  font-size: 11px;
  color: #666;
  margin: 0;
}

.tm-chat-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tm-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(1, 107, 183, 0.4);
  z-index: 1000;
  font-size: 20px;
}

.tm-chat-fab:hover {
  filter: brightness(1.08);
  color: #fff;
}

.home-checks--single {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.home-error-alert {
  margin-bottom: 20px;
}

.home-field {
  margin-bottom: 20px;
}

.home-field > label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--form-label);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.home-field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.home-field-row label {
  font-size: 14px;
  font-weight: 500;
  color: var(--form-label);
  margin: 0;
}

/* Underline inputs: light gray default, blue 2px on focus (reference) */
.home-input-line {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--form-line);
  padding: 10px 0 8px;
  font-size: 16px;
  font-family: inherit;
  color: var(--form-line-ink);
  background: transparent;
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s, border-width 0.2s, padding 0.2s;
}

.home-input-line::placeholder {
  color: #9aa3b0;
}

.home-input-line:hover:not(:focus) {
  border-bottom-color: #9eadbf;
}

.home-input-line:focus {
  border-bottom-color: var(--form-line-focus);
  border-bottom-width: 2px;
  padding-bottom: 7px;
}

/* Bordered fields inside Trustmark card (index + app pages) */
.tm-card__body .home-input-line {
  width: 100%;
  min-height: 50px;
  box-sizing: border-box;
  border: 1px solid #b8c0cc;
  border-radius: 5px;
  padding: 14px 16px;
  border-bottom: 1px solid #b8c0cc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tm-card__body .home-input-line:hover:not(:focus) {
  border-color: #9aa6b5;
  border-bottom-color: #9aa6b5;
}

.tm-card__body .home-input-line:focus {
  border-color: var(--tm-blue);
  border-bottom-color: var(--tm-blue);
  border-width: 1px;
  border-bottom-width: 1px;
  box-shadow: 0 0 0 1px var(--tm-blue);
  padding: 14px 16px;
  padding-bottom: 14px;
}

.home-show-pw {
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--form-blue);
  cursor: pointer;
  font-family: inherit;
}

.home-show-pw:hover {
  text-decoration: underline;
}

/* Checkboxes: side by side, larger, rounded, gray border */
.home-checks {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  margin: 4px 0 22px;
}

.home-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--form-label);
  cursor: pointer;
  user-select: none;
  flex: 1 1 auto;
  min-width: 0;
}

.home-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 0;
  border: 1.5px solid #8e98a6;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-grid;
  place-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.home-check input[type="checkbox"]:hover {
  border-color: #6b7482;
}

.home-check input[type="checkbox"]:checked {
  background-color: var(--form-blue);
  border-color: var(--form-blue);
}

.home-check input[type="checkbox"]:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

.home-check input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(1, 107, 183, 0.45);
  outline-offset: 2px;
}

.home-btn-signin {
  margin-top: 0;
  margin-bottom: 0;
  min-height: 50px;
  height: auto;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
}

/* "Or" between primary and secondary (reference) */
.home-form-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 14px;
  color: var(--form-blue);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
}

.home-form-divider::before,
.home-form-divider::after {
  content: "";
  flex: 1;
  min-width: 8px;
  height: 1px;
  background: var(--form-divider-line);
}

.home-form-divider span {
  flex: 0 0 auto;
}

.home-btn-secondary {
  display: block;
  width: 100%;
  height: 48px;
  margin-bottom: 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: #fff;
  color: var(--form-blue);
  border: 1px solid var(--form-blue);
  transition: background 0.15s, color 0.15s;
}

.home-btn-secondary:hover {
  background: rgba(17, 122, 202, 0.06);
}

.home-card-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  width: 100%;
}

.home-card-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--form-blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}

.home-card-link:hover {
  text-decoration: underline;
}

.home-card-link i {
  font-size: 10px;
  opacity: 0.85;
}

/* Footer */
.home-footer {
  background: #fff;
  padding: 28px 16px 32px;
  border-top: 1px solid #e8e8e8;
}

.home-footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.home-footer-social a {
  color: #8a8a8a;
  font-size: 18px;
  text-decoration: none;
  transition: color 0.15s;
}

.home-footer-social a:hover {
  color: #555;
}

.home-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-bottom: 12px;
}

.home-footer-links a {
  font-size: 12px;
  color: #666;
  text-decoration: underline;
}

.home-footer-links a:hover {
  color: #333;
}

.home-footer-links-row2 {
  margin-bottom: 24px;
}

.home-footer-bottom {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.home-footer-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  text-align: left;
}

.home-footer-ncua-wrap {
  border: 1px solid #333;
  padding: 2px;
  flex-shrink: 0;
}

.home-footer-badge-img {
  height: 35px;
  width: auto;
  display: block;
}

.home-footer-ncua-text {
  font-size: 10px;
  max-width: 360px;
  margin: 0;
  line-height: 1.35;
  color: #444;
  font-weight: 500;
}

.home-footer-copyright {
  font-size: 11px;
  color: #888;
  margin: 0;
}

@media (max-width: 600px) {
  .tm-card__body {
    padding: 24px 16px 22px;
  }

  .tm-card__logo {
    max-height: 34px;
  }
}

@media (max-width: 420px) {
  .home-checks {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 14px;
  }
}

/* =============================================
   Inner app pages (no hero background) — form + index footer
   ============================================= */

body.app-form-page {
  display: block;
  min-height: 100vh;
  color: #1a1a1a;
}

.app-form-shell {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Logo + brand bar now live in .tm-card__header */

.app-form-login-center {
  padding-top: 32px;
  padding-bottom: 40px;
}

.app-form-page-card {
  max-width: 444px;
}

.app-form-page-card--wide {
  max-width: 420px;
}

.app-form-title {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: var(--tm-blue);
  margin: 0 0 8px;
}

.app-form-title--alert {
  color: #b91c1c;
}

.app-form-title--success {
  color: #333;
}

.app-form-sub--after-success {
  margin-bottom: 24px;
}

.app-form-sub {
  font-size: 14px;
  text-align: center;
  color: #555;
  margin: 0 0 24px;
  line-height: 1.4;
}

.app-prose {
  color: #444;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.app-prose p {
  margin: 0 0 12px;
}

.app-prose p:last-child {
  margin-bottom: 0;
}

.app-form-notice {
  background: #f8fafc;
  border-radius: 8px;
  padding: 15px 16px;
  margin-top: 24px;
  text-align: left;
  border: 1px solid #e2e8f0;
}

.app-form-notice h3 {
  font-size: 13px;
  color: #059669;
  margin: 0 0 8px;
  font-weight: 600;
}

.app-form-notice p {
  font-size: 11px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.app-form-notice--otp h3 {
  color: var(--tm-blue);
}

.app-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.app-form-grid-2 .home-field {
  margin-bottom: 22px;
}

.home-line-with-suffix {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--form-line);
  padding-right: 2px;
  transition: border-color 0.2s, border-width 0.2s;
}

.home-line-with-suffix:hover:not(:focus-within) {
  border-bottom-color: #9eadbf;
}

.home-line-with-suffix:focus-within {
  border-bottom: 2px solid var(--form-line-focus);
}

.tm-card__body .home-line-with-suffix {
  border: 1px solid #b8c0cc;
  border-radius: 5px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid #b8c0cc;
  min-height: 50px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tm-card__body .home-line-with-suffix .home-input-embedded {
  padding: 14px 0;
  min-height: 0;
}

.tm-card__body .home-line-with-suffix:focus-within {
  border-color: var(--tm-blue);
  border-bottom: 1px solid var(--tm-blue);
  box-shadow: 0 0 0 1px var(--tm-blue);
}

.home-line-with-suffix .home-input-embedded {
  display: block;
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 10px 0 7px;
  font-size: 16px;
  font-family: inherit;
  color: var(--form-line-ink);
  outline: none;
}

.home-line-with-suffix .home-input-embedded::placeholder {
  color: #9aa3b0;
}

.home-line-with-suffix--error {
  border-bottom-color: #ef4444 !important;
}

.app-card-type-icon {
  font-size: 20px;
  color: #cbd5e1;
  flex-shrink: 0;
  cursor: default;
}

.app-input-otp {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.app-form-msg-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: center;
}

.app-link-resend {
  display: inline-block;
  text-align: center;
  margin-top: 20px;
  color: var(--tm-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.app-link-resend:hover {
  text-decoration: underline;
}

.app-btn-danger {
  background-color: #b91c1c !important;
  color: #fff !important;
}

.app-btn-danger:hover,
.app-btn-danger.app-btn-primary.active,
.app-btn-danger.app-btn-primary:hover {
  background-color: #991b1b !important;
  color: #fff !important;
}

body.app-form-page .app-btn-primary,
body.app-form-page .home-btn-signin {
  min-height: 50px;
  height: auto;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0;
}

body.app-form-page .app-btn-primary.active,
body.app-form-page .home-btn-signin.active {
  background-color: var(--tm-btn-active);
  color: #fff;
}

body.app-form-page .app-btn-primary.active:hover,
body.app-form-page .home-btn-signin.active:hover {
  background-color: #093d73;
  color: #fff;
}

.app-proceed-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
}

/* Success page */
.app-success-checkmark {
  width: 80px;
  height: 80px;
  border: 4px solid #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  color: #059669;
  font-size: 32px;
}

.app-success-box {
  background: #f0fdf4;
  padding: 20px;
  border-radius: 4px;
  color: #166534;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 25px;
  border: 1px solid #bbf7d0;
  text-align: center;
}

.app-success-redirect {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 25px;
  text-align: center;
}

.app-success-redirect strong {
  font-weight: 700;
  color: #059669;
}

.app-text-center {
  text-align: center;
}

.app-return-login {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background-color: var(--tm-btn-active) !important;
  color: #fff !important;
  margin-top: 8px;
}

.app-return-login:hover {
  filter: brightness(0.95);
  color: #fff;
}

@media (max-width: 500px) {
  .app-form-grid-2 {
    grid-template-columns: 1fr;
  }
}
