/* ============================================================
   FORGOT PASSWORD PAGE
   Target view : Views/CirrusShield/ForgotPassword.aspx (Site1.Master)
   Inspired by: flat reset-password layout — no card shadow,
   large bold title, muted subtitle, icon-left white input,
   full-width blue button, "< Go back to login" text link.

   !important annotations:
     (*1) h2 inline style="color:#666;text-transform:uppercase"
     (*2) h3 inline style="color:#666;"
     (*3) p  inline style="color:#666;"
     (*4) fieldset border/padding (custom.css)
     (*5) .editor-label-Err-Msg background (custom.css:4802)
     (*6) .btn.btn-green background/border/color (custom.css)
   ============================================================ */

/* ── Font override ── */
body.forgot-body,
body.forgot-body * {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* ── Hide master-page generic footer ── */
body.forgot-body #footer {
  display: none !important;
}

/* ── Body — full-page centered stage ── */
body.forgot-body {
  background: var(--bg-app);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  position: relative;
  overflow-x: hidden;
  color: var(--text-primary);
}

/* ── Ambient gradient blobs (same as login) ── */
body.forgot-body .bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
body.forgot-body .bg-decor::before {
  content: '';
  position: absolute;
  top: -15%; left: -8%;
  width: 50%; height: 60%;
  background: radial-gradient(circle, rgba(37,99,235,.06) 0%, transparent 70%);
}
body.forgot-body .bg-decor::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -8%;
  width: 45%; height: 55%;
  background: radial-gradient(circle, rgba(66,133,244,.05) 0%, transparent 70%);
}

/* ── Container — flat, no card shadow ── */
body.forgot-body .forgot-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto;
  animation: fpFadeUp 550ms var(--ease-out) both;
}

@keyframes fpFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo — hidden per design ── */
body.forgot-body .forgot-logo {
  display: none;
}

/* ── Override Site.css width:880px and margin:60px on .forgot_pwd_form ── */
body.forgot-body .forgot_pwd_form {
  width: 100% !important;
  margin: 0 !important;
  background: transparent !important;
}

/* ── Strip fieldset chrome ── */
body.forgot-body .forgot_pwd_form fieldset {
  border: none !important;           /* (*4) */
  padding: 0 !important;             /* (*4) */
  margin: 0;
  min-width: 0;
  background: transparent !important; /* custom.css:4768 sets background:#fff */
}

/* Suppress <br> spacing — gaps handled by margin ── */
body.forgot-body .forgot_pwd_form br {
  display: none;
}

/* ── Page title (H2) ── */
body.forgot-body .forgot_pwd_form h2 {
  font-size: 34px !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important; /* (*1) inline style="color:#666;" */
  text-transform: none !important;       /* (*1) inline style="text-transform:uppercase" */
  letter-spacing: -.03em;
  line-height: 1.1;
  text-align: center;
  margin: 0 0 10px !important;
}

/* ── Subtitle / instructions (H3) ── */
body.forgot-body .forgot_pwd_form h3 {
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--text-muted) !important; /* (*2) inline style="color:#666;" */
  line-height: 1.6 !important;
  text-align: center;
  margin: 0 0 28px !important;
}

/* ── Step 2 confirmation paragraph ── */
body.forgot-body .forgot_pwd_form p {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted) !important; /* (*3) inline style="color:#666;" */
  line-height: 1.6;
  text-align: center;
  margin: 0 0 28px;
}

/* ── Step 2 success icon badge ── */
body.forgot-body .fp-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue-600);
  margin: 0 auto 20px;
}

/* ── Error banner — hidden until errors exist ── */
/* :has(br) matches only when C# renders error content (each error appends a <br>).
   Claude - 20261110 - CR2345 - user-requested: redesigned to match the .fp-client-error banner
   below (icon, color recipe, entrance animation) instead of a plain text box. */
body.forgot-body .editor-label-Err-Msg {
  display: none !important;
}
body.forgot-body .editor-label-Err-Msg:has(br) {
  /* Claude - 20261110 - CR2345 - user-reported: this banner rendered down near the submit button
     regardless of where it sits in the markup (it's right below the subtitle in the DOM). Root
     cause: custom.css's legacy `.errormsg, .field-validation-error, .validation-summary-errors,
     .editor-label-Err-Msg { position: absolute; bottom: -14px; }` (custom.css:4814) was never
     overridden - with `.forgot-card` as the nearest positioned ancestor, `bottom:-14px` pinned it
     to the bottom of the WHOLE card (buttons and back-link included), not its own DOM position.
     Reset to normal flow so it renders exactly where the markup places it. */
  position: static;
  bottom: auto;
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: #fff1f0 !important; /* (*5) */
  border: 1px solid #fca5a5;
  font-size: 12.5px;
  color: #991b1b;
  line-height: 1.5;
  margin: 0 0 10px !important;
  animation: fpErrorIn 220ms var(--ease-out) both;
}

/* ── ASP.NET default validation summary ── */
body.forgot-body .validation-summary-valid,
body.forgot-body .validation-summary-errors {
  display: none !important;
}

/* ── Field labels ── */
body.forgot-body .editor-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  display: block;
  line-height: 1.4;
}

/* Claude - 20261110 - CR2345 - user-requested: this label was still inheriting Content/Site.css's
   legacy `.forgot_pwd_form .editor-label, .sign_up_form .editor-label, .change_pwd_form .editor-label`
   rule (width:20%, text-align:right, margin-right:8px) - meant for the old label-left-of-field
   desktop layout. The `display:block` set above already broke that rule's inline-block half, but
   never reset width/text-align/margin-right, so on wide viewports the label still rendered as a
   narrow, right-aligned 20%-wide column - cramped and wrapping for the longer "Security Question"
   label specifically. Scoped to this page only - every other page still sharing that legacy rule
   is untouched. */
body.forgot-body .editor-label {
  width: 100%;
  text-align: left;
  margin-right: 0;
}

/* ── Field wrapper ── */
body.forgot-body .editor-field {
  display: block !important;  /* Site.css sets display:inline-block */
  width: 100% !important;     /* Site.css sets width:50% */
  margin-bottom: 14px;
}

/* ── Input wrap — icon + input ── */
body.forgot-body .fp-input-wrap {
  position: relative;
  width: 100%;
}

/* Claude - 20261110 - CR2345 - user-reported: on the security-question field, this icon wasn't
   vertically aligned with the chosen-single text row. Root cause: with no explicit `top`, an
   absolutely-positioned element's vertical position is only centered against `.fp-input-wrap`'s
   `align-items:center` via the CSS Flexbox spec's "static position of an abspos flex child" rule -
   support for that specific rule is inconsistent, unlike `.chosen-single` itself (below), which
   centers deterministically via explicit `top:50%` + `transform:translateY(-50%)`. Made this icon
   use the same deterministic technique instead of relying on flex static-position centering. */
body.forgot-body .fp-field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
  transition: color var(--t-fast);
  z-index: 1;
}

body.forgot-body .fp-input-wrap:focus-within .fp-field-icon {
  color: var(--blue-600);
}

/* ── Text inputs ── */
body.forgot-body .fp-input-wrap input[type="text"],
body.forgot-body .fp-input-wrap input[type="password"] {
  width: 100% !important; /* Site.css media queries force 88-91% with !important on mobile */
  padding: 13px 14px 13px 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  outline: none;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

body.forgot-body .fp-input-wrap input[type="text"]::placeholder {
  color: var(--text-muted);
}

body.forgot-body .fp-input-wrap input[type="text"]:hover,
body.forgot-body .fp-input-wrap input[type="password"]:hover {
  border-color: var(--border-strong);
}

body.forgot-body .fp-input-wrap input[type="text"]:focus,
body.forgot-body .fp-input-wrap input[type="password"]:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

/* Disabled (username shown read-only in step 3) */
body.forgot-body .fp-input-wrap input:disabled {
  background: var(--bg-muted);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.75;
  border-color: var(--border);
  box-shadow: none;
}

/* ── Dropdown (security question) ── Claude - 20261110 - CR2345 - user-requested (superseding the
   prior native-select reskin): the question text should read on one line, and the dropdown should
   look/behave like the app's real Lookup field - the chosen()-managed widget used throughout
   Site.Master (record-detail.css's `.inner-edit-record .field_select .chosen-*`), same treatment
   already applied to ddlSecurityQuestion on ChangePassword.aspx (change-password.css). A native
   <select> truncates its own rendered value per-browser rather than always to a single line, and
   doesn't match the app's styled-dropdown look at all. `select#SecurityQuestion` already carries
   `lookup_select` for a different reason (BUG-BETA-571: "lookup_select keeps cuSel off this native
   select" - the same class real Lookup fields carry, since chosen() is what manages those, never
   cuSel) - chosen() itself is newly initialized on this select via this view's own HeadContent +
   page-local init script. Claude - 20261110 - CR2345 - user-requested: removed this field's
   left-side icon (previously 44px left inset to clear it, kept for the Nom d'utilisateur/Réponse
   fields); insets below now match ChangePassword's own icon-less 12/14px convention instead. */
body.forgot-body .fp-select-wrap .field_select {
  position: relative;
  width: 100%;
}

/* Overrides Content/Site.css's app-wide `.select_styled { margin-top: 5px; }` - scoped to this
   form only, every other `.select_styled` field elsewhere in the app keeps that spacing. */
body.forgot-body .cusel.select_styled.lookup_select {
  margin-top: 0;
}

body.forgot-body .fp-select-wrap .chosen-container {
  box-sizing: border-box;
  width: 100% !important;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  padding: 13px 14px;
  min-height: 46px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}

body.forgot-body .fp-select-wrap .chosen-container.chosen-container-active {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

/* `.chosen-single` is the flex row holding the truncated text + chevron, positioned against
   `.field_select` (the positioned ancestor above) rather than flowing inside `.chosen-container`'s
   own padding box - same technique change-password.css uses, so the container only supplies the
   visible chrome (border/background/shadow) while this piece centers the content against it. */
body.forgot-body .fp-select-wrap .chosen-single {
  position: absolute !important;
  top: 50%;
  left: 14px;
  right: 14px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: none;
  border: none;
}

body.forgot-body .fp-select-wrap .chosen-single:hover {
  cursor: pointer;
}

/* The one-line truncation the user asked for: long question text ellipsizes instead of wrapping. */
body.forgot-body .fp-select-wrap .chosen-single > span {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: none; /* defeats Content/Style.css's own base `.chosen-single > span { max-width: 90%; }` -
    without this, the text column was capped to 90% of the row regardless of the chevron's own space */
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  border: none; /* custom.css's own legacy `.chosen-single > span { border: 1px solid #3e82f7; }`
    base skin otherwise still applies here */
}

/* The real arrow div is hidden app-wide (Style.css `.chosen-single div{display:none}`) - this
   ::after is this field's own affordance, same chevron/rotate convention record-detail.css's own
   `.cuselFrameRight::after` uses for the inline-edit picklist. */
body.forgot-body .fp-select-wrap .chosen-single::after {
  content: "";
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%233e82f7' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / 11px 11px;
  transition: transform var(--t-fast);
}

body.forgot-body .fp-select-wrap .chosen-container-active .chosen-single::after {
  transform: rotate(180deg);
}

/* Wider than the trigger box so the (often long) question text reads on fewer wrapped lines inside
   the open panel. Scoped to `.chosen-with-drop` (chosen.js's own open-state class) so this only
   overrides position while genuinely open - Style.css's real show/hide mechanism for `.chosen-drop`
   is purely positional (`left:-9999px` hidden by default). */
body.forgot-body .fp-select-wrap .chosen-with-drop .chosen-drop {
  left: 0;
  width: calc(100% + 80px) !important;
  border: 1.5px solid var(--blue-200);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(62, 130, 247, .12), 0 2px 6px rgba(0, 0, 0, .06);
  padding: 8px;
  cursor: pointer;
}

/* This list's own scrollbar matches the thin scrollbar used elsewhere in the app - custom.css's
   plain `::-webkit-scrollbar { width: 14px; }` otherwise wins (same zero specificity, loads later). */
body.forgot-body .fp-select-wrap .chosen-results {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

body.forgot-body .fp-select-wrap .chosen-results::-webkit-scrollbar {
  width: 8px;
}

body.forgot-body .fp-select-wrap .chosen-results::-webkit-scrollbar-track {
  background: transparent;
}

body.forgot-body .fp-select-wrap .chosen-results::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 4px;
}

body.forgot-body .fp-select-wrap .chosen-results li {
  border-radius: var(--r-md);
  font-size: 14px;
  padding: 9px 12px;
  cursor: pointer;
}

/* custom.css's own `.chosen-results li.result-selected, li.disabled-result { margin-top: 5px; }`
   gives the currently-selected row a permanent extra top margin that reflows every other row's
   text on hover - reset to match the rest of the list exactly. */
body.forgot-body .fp-select-wrap .chosen-results li.result-selected {
  margin-top: 0;
}

/* custom.css's own `.chosen-results li.highlighted { background: #dfdcdc54; margin-top: 5px; }`
   adds that same shifting margin on hover/keyboard-highlight - cancelled here so hovering a row only
   adds a background, never moves its text. */
body.forgot-body .fp-select-wrap .chosen-results li.highlighted,
body.forgot-body .fp-select-wrap .chosen-results li:hover {
  background: var(--blue-50) !important;
  color: var(--blue-600) !important;
  margin-top: 0;
}

/* Only 10 fixed questions - a type-to-filter box adds nothing. Paired with `disable_search: true`
   on the chosen() init in ForgotPassword.aspx, which marks the field read-only internally but (this
   app ships no chosen.css theme) doesn't hide it by itself - this display:none is what actually
   removes it from view; the element still exists in the DOM so chosen's own keyboard navigation and
   the "chosen:hiding_dropdown" blur fix above keep working unchanged. */
body.forgot-body .fp-select-wrap .chosen-search {
  display: none;
}

/* ── Button area ── */
body.forgot-body .text-center {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

/* ── Primary button — full-width, prominent ── */
body.forgot-body .btn.btn-small.btn-green {
  width: 100%;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--blue-600) !important; /* (*6) custom.css btn-green is #4cae4c */
  border: none !important;                /* (*6) */
  color: #fff !important;                 /* (*6) */
  font-size: 15px !important;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37,99,235,.30);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

body.forgot-body .btn.btn-small.btn-green:hover {
  background: var(--blue-700) !important;
  box-shadow: 0 6px 20px rgba(37,99,235,.42);
  transform: translateY(-1px);
  color: #fff !important;
}

body.forgot-body .btn.btn-small.btn-green:active {
  transform: translateY(0) scale(.99);
}

/* ── "Go back to login" link ── */
body.forgot-body .fp-back-link {
  text-align: center;
  margin-top: 20px;
}

body.forgot-body .fp-back-link a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t-fast);
}

body.forgot-body .fp-back-link a:hover {
  color: var(--text-secondary);
}

body.forgot-body .fp-back-link svg {
  flex-shrink: 0;
}

/* ── Client-side validation error banner (matches login .editor-label-Err-Msg style) ── */
body.forgot-body .fp-client-error {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: #fff1f0;
  border: 1px solid #fca5a5;
  font-size: 12.5px;
  color: #991b1b;
  line-height: 1.5;
  margin: 0 0 10px;
  animation: fpErrorIn 220ms var(--ease-out) both;
}
body.forgot-body .fp-client-error.visible {
  display: flex;
}
body.forgot-body .fp-err-icon {
  flex-shrink: 0;
  color: #dc2626;
  margin-top: 1px;
}
@keyframes fpErrorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  body.forgot-body {
    justify-content: center;
  }
  body.forgot-body .forgot-card {
    padding: 0 20px;
  }
  body.forgot-body .forgot_pwd_form h2 {
    font-size: 26px !important;
  }
  /* Narrow viewports: the +80px overflow (above) would push the open dropdown panel past the
     screen edge - cap it to the field's own width here instead. */
  body.forgot-body .fp-select-wrap .chosen-with-drop .chosen-drop {
    width: 100% !important;
  }
}
