/*
 * Tema de acceso de Iridex.
 * Los tokens son copia de src/app/globals.css. Si cambia uno allí, hay que cambiarlo aquí.
 */

/* IBM Plex (SIL OFL 1.1, ver fonts/OFL.txt) servida desde el propio Keycloak. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  /* Copiados de globals.css */
  --foreground: #1a1c21;
  --surface: #ffffff;
  --primary: #ffaa00;
  --primary-foreground: #1a1c21;
  --primary-soft: #fef6e8;
  --secondary: #efeff1;
  --muted-foreground: #65676a;
  --subtle-foreground: #55585d;
  --destructive: #c0392b;
  --destructive-soft: #fdeaea;
  --success: #1c7a3d;
  --success-soft: #e6f6ea;
  --warning: #a84f00;
  --warning-soft: #fdeee0;
  --divider: #d7d8d9;
  --input: #797b7f;
  --ring: #ffaa00;
  /* Solo en el acceso */
  --label-empty: #757585;
  --disabled-bg: #eaebed;
  --disabled-fg: #b0b0b5;
  --strength-weak: #d64545;
  --link-brand: #4f5055;
  --art-grey: #d3d5d6;

  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --focus-ring: 0 0 0 3px rgb(255 170 0 / 0.5);

  /* PatternFly en las pantallas heredadas sin diseño */
  --pf-v5-global--FontFamily--text: var(--font-sans);
  --pf-v5-global--FontFamily--heading: var(--font-sans);
  --pf-v5-global--FontFamily--monospace: var(--font-mono);
  --pf-v5-global--primary-color--100: var(--primary);
  --pf-v5-global--primary-color--200: #e69900;
  --pf-v5-global--link--Color: var(--link-brand);
  --pf-v5-global--link--Color--hover: var(--foreground);
  --pf-v5-global--Color--100: var(--foreground);
  --pf-v5-global--BorderRadius--sm: 12px;
}

[hidden] {
  display: none !important;
}

html,
body.ix-body {
  margin: 0;
  background: var(--surface);
}

.ix-body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 16.9px;
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.ix-body *,
.ix-body *::before,
.ix-body *::after {
  box-sizing: border-box;
}
.ix-body p,
.ix-body h1 {
  margin: 0;
}
.ix-icon {
  display: block;
  flex: none;
}

/* ---------- Layout ---------- */
.ix-page {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
}

.ix-panel {
  flex: 0 1 860px;
  min-width: 0;
  min-height: calc(100vh - 32px);
  min-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
  background: var(--primary-soft);
  border-radius: 26px;
}

.ix-panel__logo {
  display: block;
  width: 130px;
  height: 38px;
}
.ix-art {
  display: block;
  width: 100%;
  max-width: 748px;
  height: auto;
  aspect-ratio: 748 / 420;
}

.ix-claim {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
}
.ix-claim__title {
  font-weight: 700;
  font-size: 30px;
  line-height: 39px;
  color: var(--foreground);
}
.ix-claim__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 13px;
  letter-spacing: 0.6px;
  color: var(--muted-foreground);
}

.ix-column {
  flex: 1 1 548px;
  min-width: 448px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 22px 0;
}

.ix-form {
  width: 400px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ix-contents {
  display: contents;
}

.ix-logo {
  display: block;
}
.ix-logo--form {
  width: 81px;
  height: 24px;
}
.ix-logo--column {
  display: none;
  width: 68px;
  height: 20px;
}

/* Móvil: sin panel y con la columna alineada arriba. */
@media (max-width: 1023px) {
  .ix-page {
    padding: 0 16px;
  }
  .ix-panel {
    display: none;
  }
  .ix-column {
    min-width: 0;
    align-items: stretch;
    justify-content: flex-start;
    padding: 24px 0;
  }
  .ix-form {
    width: 100%;
  }
  .ix-logo--form {
    width: 68px;
    height: 20px;
  }
  .ix-logo--column {
    display: block;
  }
}

/* ---------- Encabezado ---------- */
.ix-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ix-heading__title {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 24px;
  line-height: 31.2px;
  color: var(--foreground);
}
.ix-heading__text {
  font-size: 13px;
  line-height: 16.9px;
  color: var(--subtle-foreground);
  overflow-wrap: anywhere;
}
.ix-heading__note,
.ix-note {
  font-size: 12px;
  line-height: 15.6px;
  color: var(--subtle-foreground);
}

/* ---------- Campos ---------- */
.ix-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ix-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 13px;
}
.ix-field__label-row--link {
  min-height: 16px;
}

.ix-label {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  line-height: 13px;
  letter-spacing: 0.6px;
  color: var(--muted-foreground);
}
.ix-field--empty-label[data-empty] .ix-label {
  color: var(--label-empty);
}

.ix-link {
  font-size: 12px;
  line-height: 15.6px;
  color: var(--link-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 4px;
}

.ix-control {
  display: flex;
  align-items: center;
  height: 37px;
  background: var(--secondary);
  border-radius: 12px;
}
.ix-field--password .ix-control {
  height: 38px;
}
.ix-control:focus-within {
  box-shadow: var(--focus-ring);
}

.ix-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: 400 13px/16.9px var(--font-sans);
  color: var(--foreground);
  outline: none;
  box-shadow: none;
  appearance: none;
}
.ix-input::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}
/* La máscara del navegador (•) a 13 px se ve mucho más pequeña que en el diseño. */
.ix-input[type="password"]:not(:placeholder-shown) {
  font-size: 20px;
  letter-spacing: 1px;
}
.ix-input[readonly] {
  cursor: default;
}
.ix-input::-ms-reveal,
.ix-input::-ms-clear {
  display: none;
}
.ix-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--secondary) inset;
  -webkit-text-fill-color: var(--foreground);
}

.ix-show {
  flex: none;
  height: 28px;
  margin: 0 5px 0 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  font: 400 12px/15.6px var(--font-sans);
  color: var(--foreground);
  cursor: pointer;
}
.ix-show:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.ix-helper {
  font-size: 12px;
  line-height: 15.6px;
  color: var(--subtle-foreground);
}

.ix-field--error .ix-control {
  background: var(--destructive-soft);
}
.ix-field--error .ix-input,
.ix-field--error .ix-input::placeholder {
  color: var(--destructive);
}
.ix-field--error .ix-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--destructive-soft) inset;
  -webkit-text-fill-color: var(--destructive);
}
.ix-field--error .ix-helper {
  color: var(--destructive);
}

.ix-field--disabled .ix-label,
.ix-field--disabled .ix-input,
.ix-field--disabled .ix-input::placeholder,
.ix-field--disabled .ix-show {
  color: var(--disabled-fg);
}
.ix-field--disabled .ix-control {
  background: var(--disabled-bg);
}
.ix-field--disabled .ix-show {
  cursor: not-allowed;
}

/* ---------- Botones ---------- */
.ix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.ix-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.ix-btn:disabled {
  cursor: not-allowed;
}

.ix-btn--primary {
  width: 100%;
  height: 38px;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 14px;
  line-height: 18.2px;
}
.ix-btn--primary:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-fg);
}

.ix-btn--secondary {
  width: 100%;
  height: 37px;
  padding: 10px 16px;
  gap: 7px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--input);
  font-size: 14px;
  line-height: 18.2px;
}
.ix-btn--secondary:focus-visible {
  box-shadow:
    inset 0 0 0 1px var(--input),
    var(--focus-ring);
}

.ix-btn--tertiary {
  align-self: flex-start;
  height: 34px;
  padding: 8px 14px;
  gap: 6px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 15.6px;
}
.ix-btn--tertiary:disabled {
  color: var(--disabled-fg);
}

/* ---------- Alertas ---------- */
.ix-alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
}
.ix-alert--error {
  background: var(--destructive-soft);
}
.ix-alert--error .ix-alert__icon {
  color: var(--destructive);
}
.ix-alert--info {
  background: var(--secondary);
}
.ix-alert--info .ix-alert__icon {
  color: var(--subtle-foreground);
}
.ix-alert--success {
  background: var(--success-soft);
}
.ix-alert--success .ix-alert__icon {
  color: var(--success);
}

.ix-alert__icon {
  flex: none;
  width: 20px;
  height: 20px;
}
.ix-alert__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.ix-alert__title {
  font-weight: 600;
  font-size: 14px;
  line-height: 18.2px;
  color: var(--foreground);
}
.ix-alert__detail {
  font-size: 13px;
  line-height: 16.9px;
  color: var(--subtle-foreground);
}
.ix-alert__action {
  font-size: 12px;
  line-height: 15.6px;
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 4px;
}

.ix-link:focus-visible,
.ix-alert__action:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ---------- Icono de resultado ---------- */
.ix-feedback {
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 32px;
}
.ix-feedback--mail {
  background: var(--primary-soft);
  color: var(--link-brand);
}
.ix-feedback--success {
  background: var(--success-soft);
  color: var(--success);
}
.ix-feedback--warning {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ---------- Reenvío ---------- */
.ix-resend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ix-resend__text {
  font-size: 13px;
  line-height: 16.9px;
  color: var(--subtle-foreground);
}
.ix-resend .ix-btn--tertiary {
  align-self: auto;
}

/* ---------- Medidor de seguridad y requisitos ---------- */
.ix-meter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ix-meter__bars {
  display: flex;
  gap: 4px;
}
.ix-meter__bars span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--divider);
}
.ix-meter__label {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 13px;
  letter-spacing: 0.6px;
  color: var(--muted-foreground);
}
.ix-meter[data-level="0"] .ix-meter__label {
  visibility: hidden;
}
.ix-meter[data-level="1"] .ix-meter__bars span:nth-child(-n + 1),
.ix-meter[data-level="2"] .ix-meter__bars span:nth-child(-n + 2) {
  background: var(--strength-weak);
}
.ix-meter[data-level="1"] .ix-meter__label,
.ix-meter[data-level="2"] .ix-meter__label {
  color: var(--destructive);
}
.ix-meter[data-level="3"] .ix-meter__bars span:nth-child(-n + 3),
.ix-meter[data-level="4"] .ix-meter__bars span {
  background: var(--primary);
}

.ix-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ix-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 16.9px;
  color: var(--subtle-foreground);
}
.ix-check__box {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--divider);
  border-radius: 4px;
  background: var(--surface);
  color: var(--foreground);
}
.ix-check__box .ix-icon {
  width: 12px;
  height: 12px;
  visibility: hidden;
}
.ix-check[data-met] {
  color: var(--foreground);
}
.ix-check[data-met] .ix-check__box {
  border-color: var(--primary);
  background: var(--primary);
}
.ix-check[data-met] .ix-check__box .ix-icon {
  visibility: visible;
}

/* ---------- Pantallas heredadas sin diseño (PatternFly dentro del layout) ---------- */
.ix-generic {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ix-generic .pf-v5-c-form {
  --pf-v5-c-form--GridGap: 16px;
}
.ix-generic .pf-v5-c-form__label-text {
  font: 400 10px/13px var(--font-mono);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.ix-generic .pf-v5-c-form-control {
  --pf-v5-c-form-control--BackgroundColor: var(--secondary);
  --pf-v5-c-form-control--before--BorderColor: transparent;
  --pf-v5-c-form-control--after--BorderColor: transparent;
  border-radius: 12px;
  font-size: 13px;
}
.ix-generic .pf-v5-c-button {
  border-radius: 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
}
.ix-generic .pf-v5-c-button.pf-m-primary {
  --pf-v5-c-button--m-primary--BackgroundColor: var(--primary);
  --pf-v5-c-button--m-primary--Color: var(--primary-foreground);
  --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--primary);
  --pf-v5-c-button--m-primary--hover--Color: var(--primary-foreground);
}
.ix-generic .pf-v5-c-button.pf-m-secondary {
  --pf-v5-c-button--m-secondary--Color: var(--foreground);
  --pf-v5-c-button--m-secondary--after--BorderColor: var(--input);
}

/* Selección de organización para usuarios de varias empresas. No tiene diseño y usa botones secundarios. */
.ix-generic #kc-user-organizations {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ix-generic #kc-user-organizations h2 {
  margin: 0;
  font: 400 13px/16.9px var(--font-sans);
  color: var(--subtle-foreground);
}
.ix-generic #kc-user-organizations ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ix-generic #kc-user-organizations .pf-v5-c-button {
  min-height: 38px;
}
