/* ============================================
   FABSOFT PORTAL - Customer Portal styles
   ============================================
   Consumes tokens from fabsoft-variables.css (must be linked first).
   Two scopes, matching the two portal page families:

   1. body.fsp-page  — migrated public portal pages (login, forgot-password).
      These pages do NOT load the legacy /css/style.css, so full rem-based
      fs tokens render at design size (16px root).

   2. body.fsp-app   — authenticated portal app pages (reseller resources,
      purchase center, orders/licenses tables). These pages still load the
      legacy style.css (html { font-size: 62.5% }), so this scope uses px
      values plus root-size-independent tokens (colors, radius, shadows,
      font stacks) only. No rem layout here by design.
   ============================================ */

/* ========================================
   1. MIGRATED PUBLIC PAGES (.fsp-page)
   ======================================== */

body.fsp-page {
  margin: 0;
  font-family: var(--fs-font-family);
  font-size: var(--fs-text-base);
  line-height: var(--fs-leading-normal);
  color: var(--fs-text-dark);
  background: var(--fs-bg-light);
  -webkit-font-smoothing: antialiased;
}

body.fsp-page *,
body.fsp-page *::before,
body.fsp-page *::after {
  box-sizing: border-box;
}

/* Screen-reader-only utility (style.css is absent on migrated pages) */
body.fsp-page .hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Header chrome (markup lives in MasterHomeSecondary) ---- */

.fsp-page .page-header {
  background: var(--fs-gradient-dark);
}

.fsp-page .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--fs-space-4);
  max-width: var(--fs-container-xl);
  margin: 0 auto;
  padding: var(--fs-space-4) var(--fs-space-6);
}

.fsp-page .header .logo {
  height: 36px;
  width: auto;
}

.fsp-page .main-nav-list {
  display: flex;
  align-items: center;
  gap: var(--fs-space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.fsp-page .main-nav-list a {
  color: var(--fs-text-white-muted);
  text-decoration: none;
  font-size: var(--fs-text-sm);
  transition: color var(--fs-transition);
}

.fsp-page .main-nav-list a:hover,
.fsp-page .main-nav-list a:focus-visible {
  color: var(--fs-text-white);
}

/* ---- Sign-in / forgot-password card ---- */

.fsp-page .login-form {
  display: flex;
  justify-content: center;
  padding: var(--fs-space-10) var(--fs-space-6) var(--fs-space-16);
}

.fsp-page .login-container {
  background: var(--fs-card-bg);
  border: 1px solid var(--fs-card-border);
  border-radius: 16px;
  box-shadow: var(--fs-card-shadow);
  padding: var(--fs-space-8);
  width: 100%;
  max-width: 440px;
}

/* Card heading ("Sign in to your FabSoft Account") — scoped below
   .login-container so it never collides with the header logo img. */
.fsp-page .login-container .logo {
  font-size: var(--fs-text-xl);
  font-weight: var(--fs-font-semibold);
  color: var(--fs-text-dark);
  margin-bottom: var(--fs-space-6);
  text-align: center;
}

.fsp-page .form-field {
  margin-bottom: var(--fs-space-4);
}

/* Labels: unhide the sr-only span so every input has a visible label
   (MWA accessibility finding), and retire the decorative icon imgs. */
.fsp-page .form-field label {
  display: block;
  font-size: var(--fs-text-sm);
  font-weight: var(--fs-font-medium);
  color: var(--fs-text-medium);
  margin-bottom: var(--fs-space-1);
}

.fsp-page .form-field label img {
  display: none;
}

.fsp-page .form-field label .hidden {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  white-space: normal;
  overflow: visible;
}

.fsp-page .form-field input[type="text"],
.fsp-page .form-field input[type="email"],
.fsp-page .form-field input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--fs-border-light);
  border-radius: 10px;
  font-family: var(--fs-font-family);
  font-size: var(--fs-text-base);
  color: var(--fs-text-dark);
  background: var(--fs-bg-white);
  transition: border-color var(--fs-transition);
}

.fsp-page .form-field input:focus-visible,
.fsp-page .main-nav-list a:focus-visible,
.fsp-page .login-links a:focus-visible {
  outline: 2px solid var(--fs-secondary);
  outline-offset: 2px;
}

.fsp-page .form-field input[type="submit"] {
  width: 100%;
  padding: 12px 28px;
  border: none;
  border-radius: var(--fs-rounded-full);
  background: var(--fs-btn-primary-bg);
  color: var(--fs-btn-primary-text);
  font-family: var(--fs-font-family);
  font-size: var(--fs-text-base);
  font-weight: var(--fs-font-medium);
  cursor: pointer;
  transition: background var(--fs-transition), transform var(--fs-transition);
}

.fsp-page .form-field input[type="submit"]:hover {
  background: var(--fs-btn-primary-bg-hover);
  transform: translateY(-1px);
}

.fsp-page .form-field input[type="submit"]:focus-visible {
  outline: 2px solid var(--fs-secondary);
  outline-offset: 2px;
}

/* Submission feedback: clickOnce() (scripts/portal.js) disables the button
   and swaps its value to "Signing in…" — make that state visible. */
.fsp-page .form-field input[type="submit"]:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}

/* Validation summary (server-side errors) */
.fsp-page .validation-summary-errors,
.fsp-page .field-validation-error {
  color: #b3261e;
  font-size: var(--fs-text-sm);
}

.fsp-page .validation-summary-errors ul {
  margin: var(--fs-space-2) 0;
  padding-left: var(--fs-space-5);
}

/* Honeypot field (bot trap): hidden via CSS so there is no
   visible-until-JS-loads flash; the legacy onload hide stays as backup. */
.fsp-page #loginViewModel_Email {
  display: none;
}

.fsp-page .login-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--fs-space-2);
  margin-top: var(--fs-space-5);
  font-size: var(--fs-text-sm);
}

.fsp-page .login-links a {
  color: var(--fs-secondary);
  text-decoration: none;
}

.fsp-page .login-links a:hover {
  text-decoration: underline;
}

.fsp-page .forgotPassword-instructions {
  text-align: center;
  color: var(--fs-text-medium);
  font-size: var(--fs-text-sm);
  margin-bottom: var(--fs-space-4);
}

/* reCAPTCHA block centered inside the card */
.fsp-page .g-recaptcha,
.fsp-page .form-field > div[class^="grecaptcha"] {
  display: flex;
  justify-content: center;
}

/* ---- "What you're signing into" context line under the hero ---- */

.fsp-page .fsp-context {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--fs-space-8) var(--fs-space-6) 0;
  text-align: center;
  color: var(--fs-text-medium);
  font-size: var(--fs-text-base);
  line-height: var(--fs-leading-relaxed);
}

.fsp-page .fsp-context a {
  color: var(--fs-secondary);
  text-decoration: none;
}

/* ---- Minimal legal footer (ADR-0059 minimal-chrome pattern) ---- */

.fsp-page footer {
  background: var(--fs-dark);
  color: var(--fs-text-white-subtle);
  padding: var(--fs-space-6);
  text-align: center;
  font-size: var(--fs-text-sm);
}

.fsp-page footer a {
  color: var(--fs-text-white-muted);
  text-decoration: none;
  margin: 0 var(--fs-space-3);
}

.fsp-page footer a:hover {
  color: var(--fs-text-white);
}

@media (max-width: 600px) {
  .fsp-page .header {
    justify-content: center;
  }

  .fsp-page .login-container {
    padding: var(--fs-space-6);
  }
}

/* ========================================
   2. AUTHENTICATED APP PAGES (.fsp-app)
   px-based; legacy style.css stays loaded
   ======================================== */

/* Header band picks up the brand gradient (was flat #1864ab) */
body.fsp-app .page-header {
  background: var(--fs-gradient-dark);
}

body.fsp-app footer {
  background: var(--fs-dark);
  color: var(--fs-text-white-subtle);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  font-family: var(--fs-font-family);
}

body.fsp-app footer a {
  color: var(--fs-text-white-muted);
  text-decoration: none;
  margin: 0 10px;
}

/* ---- Reseller Resources landing cards (anchor cards; the legacy
        `> div` rules in style.css don't match `> a`, so this owns them) ---- */

#reseller-home .reseller-cardFlexContainer > a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 340px;
  padding: 24px;
  background: var(--fs-card-bg);
  border: 1px solid var(--fs-card-border);
  border-radius: 16px;
  box-shadow: var(--fs-card-shadow);
  text-decoration: none;
  color: var(--fs-text-dark);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

#reseller-home .reseller-cardFlexContainer > a:hover,
#reseller-home .reseller-cardFlexContainer > a:focus-visible {
  box-shadow: var(--fs-card-shadow-hover);
  transform: translateY(-3px);
}

#reseller-home .reseller-cardFlexContainer > a:focus-visible {
  outline: 2px solid var(--fs-secondary);
  outline-offset: 2px;
}

#reseller-home .reseller-cardFlexContainer > a .reseller-cardTitle {
  font-family: var(--fs-font-family);
  font-size: 20px;
  font-weight: 600;
  color: var(--fs-text-dark);
  margin-bottom: 8px;
}

#reseller-home .reseller-cardFlexContainer > a .reseller-cardDesc {
  font-family: var(--fs-font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fs-text-medium);
}

#reseller-home .reseller-cardFlexContainer > a .reseller-cardLink {
  margin-top: 16px;
  font-family: var(--fs-font-family);
  font-size: 14px;
  font-weight: 500;
  color: var(--fs-secondary);
}

/* ---- Purchase Center product tiles ---- */

body.fsp-app .purchaseCenter-header h2,
body.fsp-app .purchaseCenter-section {
  font-family: var(--fs-font-family);
  color: var(--fs-text-dark);
}

body.fsp-app .purchaseCenter-product {
  background: var(--fs-card-bg);
  border: 1px solid var(--fs-card-border);
  border-radius: 14px;
  box-shadow: var(--fs-card-shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

body.fsp-app .purchaseCenter-product:hover {
  box-shadow: var(--fs-card-shadow-hover);
  transform: translateY(-3px);
}

body.fsp-app .purchaseCenter-productLink {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: var(--fs-text-dark);
}

body.fsp-app .purchaseCenter-productText {
  font-family: var(--fs-font-family);
  color: var(--fs-text-medium);
}

/* Trust + pricing reassurance strip under the purchase-center header */
body.fsp-app .fsp-purchase-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px auto 22px;
  padding: 0 20px;
  font-family: var(--fs-font-family);
}

body.fsp-app .fsp-purchase-trust span {
  display: inline-block;
  padding: 6px 14px;
  background: var(--fs-bg-white);
  border: 1px solid var(--fs-border-light);
  border-radius: 999px;
  font-size: 13px;
  color: var(--fs-text-medium);
}

/* ---- Data tables (orders, licenses, invoices, quotes, users, cart) ----
   Generic uplift: modern spacing, hairline rules, hover rows. Scoped to
   main content so admin widgets/nav are untouched. */

body.fsp-app main table {
  border-collapse: collapse;
  background: var(--fs-bg-white);
  border: 1px solid var(--fs-border-light);
  border-radius: 12px;
  overflow: hidden;
}

body.fsp-app main th {
  background: var(--fs-bg-light);
  color: var(--fs-text-dark);
  font-family: var(--fs-font-family);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--fs-border-light);
}

body.fsp-app main td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--fs-border-light);
  font-family: var(--fs-font-family);
  color: var(--fs-text-medium);
}

body.fsp-app main tr:last-child td {
  border-bottom: none;
}

body.fsp-app main tbody tr:hover td {
  background: var(--fs-bg-lighter);
}
