/* ===================================
   Azure AD B2C Custom Page Styles
   Shared Azure AD B2C Stylesheet
   =================================== */

/* ===================================
   CSS Reset & Base Styles
   =================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
    "Droid Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #f9fafb;
  min-height: 100vh;
}

/* ===================================
   Page Layout - Split Screen Design
   =================================== */

.page-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Left Panel - Branding */
.brand-panel {
  flex: 1;
  background: linear-gradient(165deg, #d4d8e8 0%, #c5cae0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.brand-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.brand-logo img {
  height: 48px;
  width: auto;
}

.brand-logo-text {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.brand-logo-text .health {
  color: #00bfa5;
}

.brand-logo-text .talk {
  color: #1e3a8a;
}

.brand-version {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 2rem;
}

.brand-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

.brand-description {
  font-size: 1rem;
  color: #4b5563;
  line-height: 1.7;
}

/* Right Panel - Auth Form */
.auth-panel {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

/* ===================================
   Azure AD B2C Injected Form Styles
   =================================== */

#api {
  margin-bottom: 1.5rem;
}

/* Hide "What is this?" help links on form fields only (B2C injects these on every field) 
   NOTE: Be specific to NOT hide TOTP help links like "Can't scan?" and "Still having trouble?" */
#api .attrEntry a.helpLink,
#api .attrEntry .helpLink,
#api .entry-item a.helpLink,
#api .entry-item .helpLink,
#api label + a.helpLink {
  display: none !important;
}

/* Remove bullet points from B2C form field list items */
#api ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#api li,
#api .attrEntry {
  list-style: none;
}

/* Verification code helper text (injected via JS) */
.verification-help-text {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.5;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  padding: 0.5rem 0.75rem;
  background-color: #f3f4f6;
  border-radius: 6px;
  border-left: 3px solid #0033a0;
}

/* B2C section titles ("User Details") and subtitles ("Please provide the following details.") */
#api > h2,
#api > h3,
#api .intro h2,
#api .intro h3,
#api .heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

#api > .intro > p {
  font-size: 0.9375rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

/* Show and style only the main H1 title */
#api > h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 2rem;
}

/* Input fields */
#api input[type="text"],
#api input[type="email"],
#api input[type="password"],
#api input[type="tel"] {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

#api input[type="text"]:focus,
#api input[type="email"]:focus,
#api input[type="password"]:focus,
#api input[type="tel"]:focus {
  outline: none;
  border-color: #0033a0;
  box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.1);
}

#api input[type="text"]:hover:not(:focus),
#api input[type="email"]:hover:not(:focus),
#api input[type="password"]:hover:not(:focus),
#api input[type="tel"]:hover:not(:focus) {
  border-color: #9ca3af;
}

#api input::placeholder {
  color: #9ca3af;
}

/* Labels */
#api label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0;
  margin-top: 0.5rem;
}

#api label abbr {
  color: #dc2626;
  text-decoration: none;
}

/* Required field asterisks via CSS ::after */
#api label[for="signInName"]::after,
#api label[for="password"]::after,
#api label[for="email"]::after,
#api label[for="newPassword"]::after,
#api label[for="reenterPassword"]::after {
  content: " *";
  color: #dc2626;
  font-weight: 600;
}

/* Primary Button - Deep Blue */
#api button[type="submit"],
#api button.primary,
#api input[type="submit"],
#api .buttons button:first-child {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #0033a0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1.5rem;
  font-family: inherit;
}

#api button[type="submit"]:hover,
#api button.primary:hover,
#api input[type="submit"]:hover,
#api .buttons button:first-child:hover {
  background-color: #002875;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 51, 160, 0.25);
}

#api button[type="submit"]:active,
#api button.primary:active,
#api input[type="submit"]:active,
#api .buttons button:first-child:active {
  transform: translateY(0);
}

#api button[type="submit"]:focus,
#api button.primary:focus,
#api input[type="submit"]:focus,
#api .buttons button:first-child:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.3);
}

/* Social provider buttons styling */
#api .accountButton,
#api .socialButton,
#api button[id*="Provider"],
#api button.accountButton {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  background-color: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

#api .accountButton:hover,
#api .socialButton:hover,
#api button[id*="Provider"]:hover,
#api button.accountButton:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#api .accountButton:focus,
#api .socialButton:focus,
#api button[id*="Provider"]:focus,
#api button.accountButton:focus {
  outline: none;
  border-color: #0033a0;
  box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.1);
}

/* Social button container */
#api .options,
#api .accountButtons {
  margin-bottom: 1.5rem;
}

#api .options .intro,
#api .accountButtons .intro {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

/* Cancel button (B2C signup flow and TOTP) */
#api #cancel,
#api button#cancel,
#api button[id*="cancel" i] {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  background-color: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.75rem;
  font-family: inherit;
}

#api #cancel:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#api #cancel:focus {
  outline: none;
  border-color: #0033a0;
  box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.1);
}

/* Secondary buttons */
#api button[type="button"]:not(.accountButton):not([id*="Provider"]),
#api button.secondary {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  background-color: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.75rem;
  font-family: inherit;
}

#api button[type="button"]:not(.accountButton):not([id*="Provider"]):hover,
#api button.secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

#api button[type="button"]:not(.accountButton):not([id*="Provider"]):focus,
#api button.secondary:focus {
  outline: none;
  border-color: #0033a0;
  box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.1);
}

/* ===================================
   "Don't have an account? Sign up" Section
   =================================== */

#api .create {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

#api .create p {
  font-size: 0.9375rem;
  color: #6b7280;
  line-height: 1.5;
}

#api .create a {
  color: #0033a0;
  font-weight: 600;
  text-decoration: none;
  margin-left: 0.375rem;
  transition: color 0.2s ease;
}

#api .create a:hover {
  color: #002875;
  text-decoration: underline;
}

#api .create a:focus {
  outline: 2px solid #0033a0;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Dividers - Hide all by default, show specific ones */
#api .divider,
#api hr {
  display: none !important;
}

/* First divider after social buttons (with OR) */
#api .accountButtons + .divider,
#api .accountButtons + hr,
#api .options + .divider,
#api .options + hr {
  display: flex !important;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 400;
  text-transform: lowercase;
  border: none;
  height: auto;
}

#api .accountButtons + .divider::before,
#api .accountButtons + .divider::after,
#api .accountButtons + hr::before,
#api .accountButtons + hr::after,
#api .options + .divider::before,
#api .options + .divider::after,
#api .options + hr::before,
#api .options + hr::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

#api .accountButtons + .divider::before,
#api .accountButtons + hr::before,
#api .options + .divider::before,
#api .options + hr::before {
  margin-right: 1rem;
}

#api .accountButtons + .divider::after,
#api .accountButtons + hr::after,
#api .options + .divider::after,
#api .options + hr::after {
  margin-left: 1rem;
}

/* Second divider before create account button */
#api .create + .divider,
#api .create + hr,
#api #createAccount + .divider,
#api #createAccount + hr,
#api button[id*="signup"] ~ .divider,
#api button[id*="signup"] ~ hr {
  display: flex !important;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 400;
  border: none;
  height: auto;
}

#api .create + .divider::before,
#api .create + .divider::after,
#api .create + hr::before,
#api .create + hr::after,
#api #createAccount + .divider::before,
#api #createAccount + .divider::after,
#api #createAccount + hr::before,
#api #createAccount + hr::after,
#api button[id*="signup"] ~ .divider::before,
#api button[id*="signup"] ~ .divider::after,
#api button[id*="signup"] ~ hr::before,
#api button[id*="signup"] ~ hr::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

#api .create + .divider::before,
#api .create + hr::before,
#api #createAccount + .divider::before,
#api #createAccount + hr::before,
#api button[id*="signup"] ~ .divider::before,
#api button[id*="signup"] ~ hr::before {
  margin-right: 1rem;
}

#api .create + .divider::after,
#api .create + hr::after,
#api #createAccount + .divider::after,
#api #createAccount + hr::after,
#api button[id*="signup"] ~ .divider::after,
#api button[id*="signup"] ~ hr::after {
  margin-left: 1rem;
}

/* Remember me checkbox and forgot password link positioning */
#api .attrEntry:has(input[type="checkbox"]),
#api .attrEntry:has(#rememberMe),
#api div:has(> input[type="checkbox"]) {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  margin-bottom: 0;
}

#api .attrEntry:has(input[type="checkbox"]) label,
#api div:has(> input[type="checkbox"]) label {
  display: flex;
  align-items: center;
  margin: 0;
  order: 1;
  flex: 0 1 auto;
}

#api .attrEntry:has(input[type="checkbox"]) #forgotPassword,
#api .attrEntry:has(input[type="checkbox"]) a[href*="forgot"],
#api div:has(> input[type="checkbox"]) #forgotPassword,
#api div:has(> input[type="checkbox"]) a[href*="forgot"] {
  order: 2;
  margin: 0;
  margin-left: auto;
}

/* Links */
#api a {
  color: #0033a0;
  text-decoration: none;
  transition: color 0.2s ease;
}

#api a:hover {
  color: #002875;
  text-decoration: underline;
}

#api a:focus {
  outline: 2px solid #0033a0;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Error messages */
#api .error,
#api .error-message,
#api [class*="error"],
#api .verificationErrorText {
  color: #dc2626;
  font-size: 0.875rem;
  display: block;
}

/* HealthTalk custom error banner (replaces known B2C error messages via JS) */
.ht-error-banner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
}

.ht-error-banner-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #991b1b;
}

.ht-error-banner-message {
  font-size: 0.875rem;
  font-weight: 400;
  color: #b91c1c;
  line-height: 1.5;
}

#api input.error,
#api input[aria-invalid="true"] {
  border-color: #dc2626;
  background-color: #fef2f2;
}

#api input.error:focus,
#api input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Checkbox */
#api input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: #0033a0;
}

#api input[type="checkbox"]:focus {
  outline: 2px solid #0033a0;
  outline-offset: 2px;
}

/* Loading/Disabled state */
#api button:disabled,
#api input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===================================
   B2C Processing / "Please wait" Messages
   =================================== */

.simplemodal-container #verifying_blurb {
  width: 100%;
  padding: 0.875rem 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1e3a8a;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  text-align: center;
}

/* ===================================
   Footer Section
   =================================== */

.auth-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.footer-text {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #0033a0;
}

.footer-link:focus {
  outline: 2px solid #0033a0;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Locale debug indicator */
.locale-indicator {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.5rem;
  font-family: "Courier New", monospace;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 968px) {
  .page-wrapper {
    flex-direction: column;
  }

  .brand-panel {
    min-height: 50vh;
    padding: 2rem;
  }

  .brand-card {
    padding: 2rem 1.5rem;
  }

  .brand-title {
    font-size: 1.5rem;
  }

  .brand-description {
    font-size: 0.9375rem;
  }

  .auth-panel {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .brand-panel {
    padding: 1.5rem;
  }

  .brand-card {
    padding: 1.5rem 1rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .auth-panel {
    padding: 1.5rem;
  }

  #api input[type="text"],
  #api input[type="email"],
  #api input[type="password"],
  #api input[type="tel"] {
    font-size: 1rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ===================================
   TOTP / Authenticator App MFA Styles
   =================================== */

/* TOTP page description text - clean readable style */
#api .verificationInfoText,
#api .intro p {
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Store badges container - created by JS to hold relocated badges */
.store-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
  padding: 1rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

/* Store badge links inside the container - fixed height approach */
.store-badges a,
.store-badges .googleStoreIconControlContent,
.store-badges .appStoreIconControlContent {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  float: none !important;
  width: auto !important;
  height: 40px !important;
  margin: 0 !important;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Google Play badge link - needs extra handling for built-in whitespace */
.store-badges .googleStoreIconControlContent,
.store-badges #authenticatorAppIconControl-google {
  height: 60px !important;
  margin-top: -10px !important;
  margin-bottom: -10px !important;
}

.store-badges a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Store badge images - use height for consistency */
.store-badges img {
  height: 40px !important;
  width: auto !important;
  float: none !important;
  display: block !important;
  margin: 0 !important;
  border-radius: 6px;
}

/* Google Play image - compensate for built-in whitespace in the badge */
.store-badges .googleStoreIconControlContent img,
.store-badges #authenticatorAppIconControl-google img {
  height: 60px !important;
  width: auto !important;
}

/* Fallback for badges not yet relocated by JS */
#api .googleStoreIconControlContent,
#api .appStoreIconControlContent,
#api #authenticatorAppIconControl-google,
#api #authenticatorAppIconControl-apple {
  display: inline-block !important;
  float: none !important;
  width: auto !important;
  margin: 0.5rem !important;
  vertical-align: middle;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#api .googleStoreIconControlContent:hover,
#api .appStoreIconControlContent:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Fallback badge images */
#api .googleStoreIconControlContent img,
#api .appStoreIconControlContent img,
#api #authenticatorAppIconControl-google img,
#api #authenticatorAppIconControl-apple img {
  height: 40px !important;
  width: auto !important;
  float: none !important;
  display: inline-block !important;
  margin: 0 !important;
  border-radius: 6px;
}

/* Google Play fallback - compensate for built-in whitespace */
#api .googleStoreIconControlContent img,
#api #authenticatorAppIconControl-google img {
  height: 60px !important;
}

/* Section headings within TOTP flow */
#api h3,
#api h4,
#api .heading {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

/* QR Code image - clean centered style */
#api img[alt*="QR"],
#api img[src*="qr"],
#api img[src*="QR"] {
  display: block;
  max-width: 180px;
  width: 100%;
  height: auto;
  margin: 1rem auto;
  padding: 0.75rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Table containing QR code - reset styling */
#api table {
  border-collapse: collapse;
  border: none;
  background: transparent;
  margin: 0 auto;
}

#api table td {
  padding: 0.5rem;
  border: none;
  background: transparent;
  vertical-align: top;
}

/* Hide "Can't scan? Try this" link - otpauth:// doesn't work on desktop browsers */
#api a[id*="cant"],
#api a[id*="CantScan"],
#api a.cantScanLink,
#api a[href^="otpauth://"] {
  display: none !important;
}

/* "Still having trouble?" / "Enter code manually" link (TOTP page) */
#api a[id*="trouble"],
#api a[id*="alternative"],
#api a[id*="HavingTrouble"],
#api a.havingTroubleLink {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0033a0;
  margin-top: 0.75rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  cursor: pointer;
}

#api a[id*="trouble"]:hover,
#api a[id*="alternative"]:hover,
#api a[id*="HavingTrouble"]:hover,
#api a.havingTroubleLink:hover {
  color: #002875;
  text-decoration: underline;
}

/* Manual entry / secret key section */
#api .manualEntry,
#api .secretKey,
#api div[id*="manual"],
#api div[id*="secret"] {
  margin: 1rem 0;
  padding: 1rem;
  background-color: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
}

#api .manualEntry code,
#api .secretKey code,
#api div[id*="secret"] code {
  display: block;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #713f12;
  letter-spacing: 0.1em;
  word-break: break-all;
  padding: 0.75rem;
  background-color: #fef9c3;
  border-radius: 6px;
  text-align: center;
  margin-top: 0.5rem;
}

/* TOTP code input field - larger monospace style */
#api input[id*="totp"],
#api input[id*="otp"],
#api input[name*="totp"],
#api input[name*="otp"] {
  width: 100%;
  padding: 1rem;
  font-size: 1.25rem;
  font-family: "Consolas", "Monaco", monospace;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-align: center;
  color: #0f172a;
  background-color: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#api input[id*="totp"]:focus,
#api input[id*="otp"]:focus,
#api input[name*="totp"]:focus,
#api input[name*="otp"]:focus {
  outline: none;
  border-color: #0033a0;
  box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.15);
}

/* Continue button styling */
#api button[id*="continue"],
#api button.continue,
#api #continue {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #0033a0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

#api button[id*="continue"]:hover,
#api button.continue:hover,
#api #continue:hover {
  background-color: #002875;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 51, 160, 0.25);
}

/* TOTP help text banner */
.totp-help-text {
  font-size: 0.875rem;
  color: #1e40af;
  line-height: 1.6;
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #0033a0;
  border-radius: 8px;
}

/* Mobile adjustments for TOTP */
@media (max-width: 480px) {
  .store-badges {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .store-badges img,
  #api .googleStoreIconControlContent img,
  #api .appStoreIconControlContent img {
    width: 120px !important;
  }

  #api input[id*="totp"],
  #api input[id*="otp"] {
    font-size: 1.125rem;
    letter-spacing: 0.2em;
    padding: 0.875rem;
  }

  #api img[alt*="QR"],
  #api img[src*="qr"] {
    max-width: 160px;
  }
}

/* ===================================
   CAPTCHA Styles (B2C Bot Protection)
   =================================== */

#api .captcha_container,
#api .captchaContainer,
#api div[id*="captcha"],
#api .attrEntry:has(img[alt*="CAPTCHA"]),
#api .attrEntry:has(img[src*="captcha"]) {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* CAPTCHA label */
#api .captcha_container label,
#api .captchaContainer label,
#api div[id*="captcha"] label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  display: block;
}

/* CAPTCHA image container */
#api .captcha_container img,
#api .captchaContainer img,
#api div[id*="captcha"] img,
#api img[alt*="CAPTCHA"],
#api img[src*="captcha"] {
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #f9fafb;
}

/* CAPTCHA input field */
#api .captcha_container input[type="text"],
#api .captchaContainer input[type="text"],
#api div[id*="captcha"] input[type="text"],
#api input[id*="captcha"],
#api input[name*="captcha"],
#api input[placeholder*="characters"] {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 0.5rem;
}

#api .captcha_container input[type="text"]:focus,
#api .captchaContainer input[type="text"]:focus,
#api div[id*="captcha"] input[type="text"]:focus,
#api input[id*="captcha"]:focus,
#api input[name*="captcha"]:focus,
#api input[placeholder*="characters"]:focus {
  outline: none;
  border-color: #0033a0;
  box-shadow: 0 0 0 3px rgba(0, 51, 160, 0.1);
}

/* CAPTCHA refresh/reload button */
#api .captcha_container button,
#api .captchaContainer button,
#api div[id*="captcha"] button:not([type="submit"]),
#api button[id*="refresh"],
#api button[id*="reload"] {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

#api .captcha_container button:hover,
#api .captchaContainer button:hover,
#api div[id*="captcha"] button:not([type="submit"]):hover,
#api button[id*="refresh"]:hover,
#api button[id*="reload"]:hover {
  background-color: #e5e7eb;
  border-color: #9ca3af;
}

/* CAPTCHA audio link/button (accessibility) */
#api .captcha_container a[id*="audio"],
#api .captchaContainer a[id*="audio"],
#api div[id*="captcha"] a[id*="audio"],
#api a[id*="captcha"][id*="audio"] {
  display: inline-block;
  font-size: 0.875rem;
  color: #0033a0;
  margin-top: 0.5rem;
  text-decoration: none;
}

#api .captcha_container a[id*="audio"]:hover,
#api .captchaContainer a[id*="audio"]:hover,
#api div[id*="captcha"] a[id*="audio"]:hover {
  text-decoration: underline;
}

/* ===================================
   Accessibility Enhancements
   =================================== */

@media (prefers-contrast: high) {
  #api input[type="text"],
  #api input[type="email"],
  #api input[type="password"],
  #api input[type="tel"] {
    border-width: 2px;
  }

  #api button[type="submit"],
  #api button.primary {
    border: 2px solid #001f5c;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

*:focus-visible {
  outline: 2px solid #0033a0;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
