/* ====================================
   Theme + Base
==================================== */
:root {
  --brand-blue: #0033A1;
  --brand-blue-dark: #0056b3;
  --brand-gold: #FFB71B;
  --ink-100: #212529;
  --ink-90: rgba(33, 37, 41, .85);
  --radius-lg: .75rem;
  --shadow-md: 0 8px 18px rgba(0, 0, 0, .4);
  --control-h: 46px;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink-100);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", "Liberation Sans", sans-serif,
               "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: 1.5;
  background: #f7f4eb;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  -webkit-text-size-adjust: 100%;
}

.visually-hidden {
  position: absolute !important;
  inset: 0 0 auto auto;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}

:where(a, button, input):focus {
  box-shadow: 0 0 0 3px rgba(255, 183, 27, .45);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ====================================
   Skip Link
==================================== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  padding: .5rem .75rem;
  background: #fffbcc;
  color: #111;
  outline: 2px solid var(--brand-blue);
  border-radius: .375rem;
  z-index: 10000;
}

/* ====================================
   Header
==================================== */
.header {
  background: var(--brand-blue);
  color: #fff;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  border-block-end: 2px solid var(--brand-blue);
}

.header img {
  max-height: 40px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* ====================================
   Layout / Shell
==================================== */
main.signin-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  justify-content: center;
}

.login-section {
  display: flex;
  flex: 1;
}

.text-start {
  text-align: left;
}

/* Center login panel with no background image */
.auth-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: #f7f4eb;
}

.auth-panel {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  padding: 32px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ====================================
   Form
==================================== */
.form-row {
  margin: 0 0 1rem;
}

.form-label {
  font-weight: 700;
  color: #00274c;
  margin: 0 0 .25rem;
}

.form-control {
  width: 100%;
  height: var(--control-h);
  border: 1px solid #ccc;
  border-radius: .375rem;
  background: #fff;
  color: var(--ink-100);
}

/* Password group + eye button */
.password-group {
  display: flex;
  align-items: stretch;
  border: 1px solid #ccc;
  border-radius: .375rem;
  background: #fff;
  overflow: hidden; /* keeps corners clean when focused */
}

/* Input inside password group */
.password-group .form-control {
  flex: 1 1 auto;
  height: var(--control-h);
  border: 0;
  border-radius: 0;
}

/* Eye toggle button */
.password-group .btn-toggle-password {
  border: 0;
  border-left: 1px solid #ccc;
  height: var(--control-h);
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  line-height: 1;
  gap: .25rem;
  background: #fff;
  cursor: pointer;
}

/* Inline SVG icon sizing for password eye */
.btn-toggle-password .icon {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  display: inline-block;
  vertical-align: middle;
}

/* Remove individual focus ring inside password group */
.password-group :where(input, button):focus,
.password-group :where(input, button):focus-visible {
  outline: none;
  box-shadow: none;
}

/* Show focus ring around the entire password group */
.password-group:focus-within {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(255, 183, 27, .45);
}

/* Buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  border: 0;
  background: transparent;
}

.btn-login {
  width: 100%;
  padding: 10px;
  font-size: 1.125rem;
  border-radius: .5rem;
  background: var(--brand-blue);
  color: #fff;
}

.btn-login:hover,
.btn-login:focus-visible {
  background: var(--brand-blue-dark);
  color: #fff;
}

.login-note {
  color: var(--ink-90);
  text-align: center;
  margin: 1rem 0 0;
}

/* ====================================
   Error Messaging
==================================== */
.login-error {
  display: flex;
  align-items: flex-start;
  gap: .5rem;

  /* High-contrast error banner */
  background: #f8d7da; /* light red */
  color: #721c24;      /* dark red text */
  border-radius: .375rem;
  padding: .75rem .875rem;
  margin: 0 0 1rem;

  font-weight: 600;
  text-align: left;

  opacity: 0;
  transition: opacity .16s ease-in;
}

.login-error.show {
  opacity: 1;
}

.login-error-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;

  background: #721c24; /* same dark red as text */
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.login-error-text {
  margin: 0;
}

/* ====================================
   Link Sections + Accordion
==================================== */
.login-links {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  border-top: 2px solid #ccc;
  margin-top: 48px;
  background-color: #fafafa;
  border-radius: 6px;
  padding: 24px 10px 16px;
}

.section-heading {
  margin: 0;
}

.accordion-toggle {
  width: 100%;
  background: transparent;
  border: none;
  font-size: .95rem;
  font-weight: 700;
  color: #00274c;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .5rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  gap: .5rem;
}

.accordion-text {
  display: inline-block;
}

.accordion-icon::before {
  content: "+";
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
}

.accordion-toggle[aria-expanded="true"] .accordion-icon::before {
  content: "–";
}

/* Link list */
.link-group {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-group > li {
  margin: 0;
  padding: 0;
}

.link-group[hidden] {
  display: none !important;
}

/* ====================================
   Footer
==================================== */
.footer {
  flex-shrink: 0;
  padding: 16px 20px;
  background: var(--brand-blue);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  text-decoration: underline;
}

.social-icons {
  display: flex;
  gap: 12px;
}

.social-icons a {
  color: #fff;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icons a:hover,
.social-icons a:focus-visible {
  color: var(--brand-gold);
}

.social-icons .icon {
  width: 30px;
  height: 30px;
}

/* ====================================
   Logout Layout
==================================== */
.logout-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.logout-container {
  margin: 50px auto;
  padding: 30px;
  max-width: 600px;
  background: #fff;
  border-radius: .5rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .1);
  text-align: center;
}

/* Center text for logout / error containers */
.text-center,
.logout-container,
.login-container.text-center {
  text-align: center;
}

.logout-title,
.logout-container h2 {
  color: #0033A1;
  font-weight: 700;
  margin: 0 0 20px;
}

.logout-container p {
  margin: 0 0 15px;
}

.btn-return {
  background: #FFB71B;
  color: #011D49;
  border: 0;
  font-size: 1rem;
  padding: 10px 20px;
  margin-top: 20px;
  border-radius: .375rem;
  font-weight: 700;
}

.btn-return:hover,
.btn-return:focus-visible {
  background: #FFC95E;
  color: #011D49;
}

/* ====================================
   Responsive Layout
==================================== */

/* Login links spacing on small screens */
@media (max-width: 576px) {
  .login-links {
    margin-top: 32px;
  }
}

/* Desktop layout for auth shell */
@media (min-width: 992px) {
  .auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-panel {
    padding: clamp(20px, 4vw, 40px);
  }

  .login-container {
    padding: 32px 40px;
    max-width: 760px;
  }
}

/* Accordion / link layout */
@media (min-width: 577px) {
  .link-section {
    text-align: center;
  }

  .accordion-toggle {
    pointer-events: none;
    justify-content: center;
  }

  .accordion-icon {
    display: none;
  }

  .link-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: .5em;
  }

  .link-chip {
    display: inline-block;
    padding: 0;
    color: var(--brand-blue);
    text-decoration: none;
    font-size: 1rem;
  }

  .link-chip:hover,
  .link-chip:focus-visible {
    text-decoration: underline;
    background: none;
  }
}

@media (max-width: 576px) {
  .link-section {
    text-align: left;
  }

  .link-section button {
    text-align: left;
  }

  .link-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: .25rem .75rem .75rem;
  }

  .link-chip {
    display: block;
    width: 100%;
    padding: 8px;
    font-size: 1rem;
    color: var(--brand-blue);
    text-decoration: none;
    border-radius: .375rem;
  }

  .link-chip:hover,
  .link-chip:focus-visible {
    background-color: rgba(0, 51, 161, 0.06);
    text-decoration: underline;
  }
}

/* Footer behavior in narrow embedded popups */
@media (max-width: 699px) {
  .footer {
    flex-direction: column;
    align-items: flex-start; /* keep left-aligned, not centered */
    gap: 10px;
  }

  .footer-links,
  .social-icons {
    width: 100%;
  }

  .social-icons {
    justify-content: flex-start;
  }
}