/* ApexC sign-in, sign-up and password pages (views/new_template/auth_header.php).
   Loaded after landing_assets/apexc/site.css, which supplies the shared top
   bar and footer; these rules only style the image panel and the forms.
   Archivo headings, IBM Plex Sans body, ApexC blue for GC, brand red for CM Flex. */

:root {
  --background: #ffffff;
  --foreground: #121a2e;
  --muted-foreground: #5f6b80;
  --border: #e1e6ee;
  --input: #d9dfe8;
  --primary: #1f4fb3;
  --primary-hover: #1b459c;
  --primary-ring: rgba(31, 79, 179, 0.25);
  --brand-red: #cf2f2b;
  --brand-red-hover: #b62925;
  --accent: #eef2fb;
  --navy: #0f1a33;
  --navy-foreground: #f4f6fa;
  --gold: #e3a833;
  --destructive: #c8312b;
  --success: #17804a;
  --warning: #9a6200;
  --gc: var(--primary);
  --cm: var(--brand-red);
  --radius: 0.5rem;
  --font-display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

@supports (color: oklch(0 0 0)) {
  :root {
    --foreground: oklch(0.2 0.04 258);
    --muted-foreground: oklch(0.5 0.03 255);
    --border: oklch(0.91 0.012 250);
    --input: oklch(0.89 0.014 250);
    --primary: oklch(0.45 0.17 258);
    --primary-hover: oklch(0.41 0.16 258);
    --primary-ring: oklch(0.45 0.17 258 / 0.25);
    --brand-red: oklch(0.55 0.21 27);
    --brand-red-hover: oklch(0.5 0.2 27);
    --accent: oklch(0.95 0.02 255);
    --navy: oklch(0.22 0.06 260);
    --navy-foreground: oklch(0.97 0.005 250);
    --gold: oklch(0.76 0.13 80);
    --destructive: oklch(0.56 0.21 25);
  }
}

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

html, body { margin: 0; padding: 0; }

body.auth-body {
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.auth-shell h1, .auth-shell h2, .auth-shell h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
}

.auth-shell a { color: var(--primary); text-decoration: none; }
.auth-shell a:hover { text-decoration: underline; }

/* ---- Buttons ---- */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.auth-shell a.auth-btn:hover { text-decoration: none; }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-btn--primary, .auth-shell a.auth-btn--primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(15, 26, 51, 0.12); }
.auth-btn--primary:hover, .auth-shell a.auth-btn--primary:hover { background: var(--primary-hover); color: #fff; }
.auth-btn--red, .auth-shell a.auth-btn--red { background: var(--brand-red); color: #fff; box-shadow: 0 1px 2px rgba(15, 26, 51, 0.12); }
.auth-btn--red:hover, .auth-shell a.auth-btn--red:hover { background: var(--brand-red-hover); color: #fff; }
.auth-btn--xl { height: 3rem; padding: 0 1.75rem; font-size: 1rem; font-weight: 600; }
.auth-btn--block { width: 100%; }

/* ---- Split layout ---- */
.auth-shell {
  display: grid;
  min-height: calc(100vh - 4rem);
}
.auth-shell__art {
  position: relative;
  display: none;
  background: var(--navy);
  overflow: hidden;
}
.auth-shell__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}
.auth-shell__art-copy {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
  color: var(--navy-foreground);
}
.auth-eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.auth-shell__tagline {
  max-width: 28rem;
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.auth-shell__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.25rem;
  background: var(--background);
}
.auth-shell__content { width: 100%; max-width: 28rem; }
.auth-title { font-size: 1.875rem; font-weight: 800; line-height: 1.15; }
.auth-sub { margin: 0.5rem 0 0; color: var(--muted-foreground); }
.auth-sub a { font-weight: 600; }
.auth-form { margin-top: 2rem; }

@media (min-width: 768px) {
  .auth-title { font-size: 2.25rem; }
}
@media (min-width: 1024px) {
  .auth-shell { grid-template-columns: 1fr 1fr; }
  .auth-shell__art { display: block; }
}

/* ---- Fields ---- */
.auth-field { margin-bottom: 1.25rem; }

.auth-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--foreground);
}
.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.auth-label-row .auth-label { margin-bottom: 0; }
.auth-label-row a { font-size: 0.875rem; font-weight: 500; }
.auth-input {
  display: block;
  width: 100%;
  height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(15, 26, 51, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: var(--muted-foreground); opacity: 0.8; }
.auth-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.auth-input.error { border-color: var(--destructive); }

.auth-grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 480px) {
  .auth-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Password with show/hide toggle. The icon sits on the input, not the
   field, so a validation message below does not move it. */
.auth-pass { position: relative; }
.auth-pass .auth-input { padding-right: 2.5rem; }
.auth-pass__eye {
  position: absolute;
  top: 1.375rem;
  right: 0.75rem;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  cursor: pointer;
}
.auth-pass__eye:hover { color: var(--foreground); }

/* jquery.validate messages */
label.error {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--destructive);
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.auth-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.auth-check a { text-decoration: underline; }

.auth-footnote {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.auth-footnote a { font-weight: 600; }

/* ---- Product cards (registration) ---- */
.auth-products { margin: 0 0 1.25rem; padding: 0; border: 0; }
.auth-products legend { padding: 0; }
.auth-products__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.auth-product {
  position: relative;
  display: block;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-product input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.auth-product svg { display: block; width: 1.25rem; height: 1.25rem; }
.auth-product--gc svg { color: var(--gc); }
.auth-product--cm svg { color: var(--cm); }
.auth-product__name {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 800;
}
.auth-product__desc { margin: 0; font-size: 0.75rem; color: var(--muted-foreground); }
.auth-product--gc.is-selected { border-color: var(--gc); box-shadow: 0 0 0 1px var(--gc); }
.auth-product--cm.is-selected { border-color: var(--cm); box-shadow: 0 0 0 1px var(--cm); }
.auth-product:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-ring); }

/* ---- Captcha ---- */
.auth-captcha { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.5rem; }
.auth-captcha__code {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--navy);
  color: var(--navy-foreground);
  font-family: "Courier New", monospace;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.375rem;
  text-decoration: line-through;
  user-select: none;
}
.auth-captcha__refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted-foreground);
}
.auth-shell a.auth-captcha__refresh:hover { background: var(--accent); color: var(--foreground); text-decoration: none; }

/* ---- Server messages (success_msg / error_msg / warning_msg markup) ---- */
#rjres:empty { display: none; }
#rjres { margin-top: 1.5rem; }
#rjres .alert {
  position: relative;
  margin: 0;
  padding: 0.75rem 2.25rem 0.75rem 1rem;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.45;
}
#rjres .alert + .alert { margin-top: 0.5rem; }
#rjres .alert a, #rjres .alert .alert-link { color: inherit; font-weight: 600; }
#rjres .alert-danger { background: #fdf0ef; border-color: #f3c7c4; color: #8f1f1a; }
#rjres .alert-success { background: #eef8f2; border-color: #bfe3cd; color: #0f5c34; }
#rjres .alert-warning { background: #fdf6e7; border-color: #f0dbab; color: #7a4d00; }
#rjres .alert-info { background: #eef2fb; border-color: #c9d6f2; color: #1b3f8f; }
#rjres .alert .close {
  position: absolute;
  top: 0.45rem;
  right: 0.6rem;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
}
#rjres .alert .close:hover { opacity: 1; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 479px) {
  .auth-shell__panel { padding: 2.5rem 1rem; }
}
