/*
 * Trovato login theme. Mirrors apps/web/components/auth/SignInShell.tsx and the
 * @trovato/ui tokens (packages/ui/src/tokens/colors.ts). PatternFly 3 loads
 * underneath and sets `html { font-size: 10px }`, so sizes here are in px and
 * every rule is scoped under `.tv-body` to win over Bootstrap's element rules.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
}

.tv-html {
  --tv-surface: hsl(40 20% 99%);
  --tv-surface-raised: hsl(40 18% 97%);
  --tv-surface-muted: hsl(40 14% 95%);
  --tv-border: hsl(40 10% 90%);
  --tv-border-strong: hsl(220 15% 70%);
  --tv-ink: hsl(220 18% 14%);
  --tv-ink-subtle: hsl(220 10% 34%);
  --tv-ink-muted: hsl(220 9% 40%);
  --tv-accent: hsl(220 45% 30%);
  --tv-accent-hover: hsl(220 45% 25%);
  --tv-accent-soft: hsl(220 35% 94%);
  --tv-ring: hsl(220 45% 40%);
  --tv-danger: hsl(0 60% 42%);
  --tv-danger-soft: hsl(0 70% 96%);
  --tv-success: hsl(155 45% 32%);
  --tv-success-soft: hsl(155 35% 95%);
  --tv-warning: hsl(35 85% 32%);
  --tv-warning-soft: hsl(35 85% 95%);
  --tv-gold: #f5c451;
  --tv-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tv-serif: "Source Serif 4", Georgia, serif;
  height: 100%;
  background: var(--tv-surface);
}

.tv-body {
  margin: 0;
  min-height: 100%;
  background: var(--tv-surface);
  color: var(--tv-ink);
  font-family: var(--tv-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
}

.tv-body ::selection {
  background-color: hsl(220 45% 88%);
  color: hsl(220 45% 18%);
}

/* ---------- Frame ---------- */

.tv-body .tv-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1024px) {
  .tv-body .tv-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  }
}

.tv-body .tv-main {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 28px 24px;
}

@media (min-width: 640px) {
  .tv-body .tv-main {
    padding: 28px 40px;
  }
}

.tv-body .tv-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--tv-accent);
}

.tv-body .tv-brand__mark {
  width: auto;
  height: 24px;
}

.tv-body .tv-brand__name {
  font-family: var(--tv-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--tv-ink);
}

.tv-body .tv-content {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 56px 0;
}

.tv-body .tv-card {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.tv-body .tv-footer {
  text-align: center;
  font-size: 12px;
  line-height: 16px;
  color: var(--tv-ink-muted);
}

/* ---------- Brand panel ---------- */

.tv-body .tv-art {
  display: none;
  padding: 12px;
}

@media (min-width: 1024px) {
  .tv-body .tv-art {
    display: block;
  }
}

/* "Bolsa de Madrid" by L'Odyssée Belle on Unsplash (Unsplash License), cropped
   to its columns: the same file and shade as the web app's SignInShell. */
.tv-body .tv-art__frame {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 20px;
  background-color: #121a2b;
  background-image: linear-gradient(180deg, rgba(18,26,43,0.18) 0%, rgba(18,26,43,0.32) 45%, rgba(14,21,36,0.94) 100%),
    url("../img/sign-in-photo.jpg");
  background-position: center;
  background-size: cover;
}

.tv-body .tv-art__caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-width: 576px;
  padding: 0 48px 48px;
}

.tv-body .tv-art__eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tv-gold);
}

.tv-body .tv-art__quote {
  margin: 16px 0 0;
  font-family: var(--tv-serif);
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
}

.tv-body .tv-art__text {
  max-width: 448px;
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.625;
  color: rgb(255 255 255 / 0.75);
}

/* ---------- Header ---------- */

.tv-body .tv-header {
  margin-bottom: 28px;
}

.tv-body .tv-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tv-accent);
}

.tv-body .tv-title {
  margin: 0;
  font-family: var(--tv-serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--tv-ink);
}

.tv-body .tv-subtitle,
.tv-body #kc-content .instruction,
.tv-body #kc-content > p,
.tv-body #kc-info-message > p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--tv-ink-subtle);
}

.tv-body .tv-required-note {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--tv-ink-muted);
}

.tv-body .required {
  color: var(--tv-danger);
}

.tv-body .tv-username {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  background: var(--tv-surface-raised);
}

.tv-body .tv-username__value {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-body .tv-username__restart {
  flex-shrink: 0;
  font-size: 13px;
}

/* ---------- Locale ---------- */

.tv-body .tv-locale {
  position: absolute;
  top: -48px;
  right: 0;
}

.tv-body .tv-locale__dropdown > button {
  padding: 4px 8px;
  border: 1px solid var(--tv-border);
  border-radius: 6px;
  background: var(--tv-surface);
  font: inherit;
  font-size: 13px;
  color: var(--tv-ink-subtle);
}

.tv-body .tv-locale__menu {
  display: none;
  position: absolute;
  right: 0;
  z-index: 10;
  min-width: 160px;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  background: var(--tv-surface);
  box-shadow: 0 8px 24px rgb(16 24 40 / 0.12);
}

.tv-body .tv-locale__dropdown > button[aria-expanded="true"] + .tv-locale__menu {
  display: block;
}

.tv-body .tv-locale__menu a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--tv-ink);
  text-decoration: none;
}

.tv-body .tv-locale__menu a:hover {
  background: var(--tv-surface-muted);
}

/* ---------- Links ---------- */

.tv-body a {
  color: var(--tv-ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--tv-border-strong);
  text-underline-offset: 4px;
}

.tv-body a:hover,
.tv-body a:focus {
  color: var(--tv-ink);
  text-decoration-color: var(--tv-ink);
}

.tv-body a:focus-visible,
.tv-body button:focus-visible,
.tv-body input:focus-visible {
  outline: 2px solid var(--tv-ring);
  outline-offset: 2px;
}

/* ---------- Alerts ---------- */

.tv-body .tv-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 20px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
}

.tv-body .tv-alert--error {
  border-color: hsl(0 60% 42% / 0.2);
  background: var(--tv-danger-soft);
  color: var(--tv-danger);
}

.tv-body .tv-alert--warning {
  border-color: hsl(35 85% 32% / 0.2);
  background: var(--tv-warning-soft);
  color: var(--tv-warning);
}

.tv-body .tv-alert--success {
  border-color: hsl(155 45% 32% / 0.2);
  background: var(--tv-success-soft);
  color: var(--tv-success);
}

.tv-body .tv-alert--info {
  border-color: hsl(220 45% 30% / 0.15);
  background: var(--tv-accent-soft);
  color: var(--tv-accent);
}

.tv-body .tv-alert .tv-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------- Form ---------- */

.tv-body .tv-form,
.tv-body #kc-form-login,
.tv-body form {
  margin: 0;
}

.tv-body .tv-field {
  margin: 0 0 18px;
}

.tv-body .tv-label-wrapper,
.tv-body .tv-input-wrapper,
.tv-body .tv-options,
.tv-body .tv-options-wrapper,
.tv-body .tv-actions,
.tv-body .tv-actions-wrapper,
.tv-body .tv-content-wrapper,
.tv-body .tv-info-wrapper {
  float: none;
  width: auto;
  padding: 0;
  margin: 0;
}

.tv-body .tv-label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: var(--tv-ink);
}

.tv-body .tv-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.04);
  font-family: var(--tv-sans);
  font-size: 15px;
  color: var(--tv-ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.tv-body textarea.tv-input {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
}

.tv-body .tv-input::placeholder {
  color: hsl(220 7% 43%);
}

.tv-body .tv-input:hover {
  border-color: var(--tv-border-strong);
}

.tv-body .tv-input:focus,
.tv-body .tv-input:focus-visible {
  outline: none;
  border-color: var(--tv-ring);
  box-shadow: 0 0 0 3px hsl(220 45% 40% / 0.18);
}

.tv-body .tv-input[aria-invalid="true"] {
  border-color: var(--tv-danger);
}

.tv-body .tv-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px hsl(0 60% 42% / 0.15);
}

.tv-body .tv-input:disabled,
.tv-body .tv-input[readonly] {
  background: var(--tv-surface-muted);
  color: var(--tv-ink-subtle);
}

.tv-body .tv-input-group {
  position: relative;
  display: block;
  width: 100%;
}

.tv-body .tv-input-group > .tv-input {
  padding-right: 48px;
}

.tv-body .tv-reveal {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--tv-ink-muted);
  cursor: pointer;
}

.tv-body .tv-reveal:hover {
  color: var(--tv-ink);
}

.tv-body .tv-field-error,
.tv-body .tv-help {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 18px;
  color: var(--tv-ink-muted);
}

.tv-body .tv-field-error {
  color: var(--tv-danger);
}

.tv-body .tv-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 22px;
  font-size: 13px;
}

.tv-body .tv-settings:has(#kc-form-options:empty) {
  justify-content: flex-end;
}

.tv-body #kc-form-options .checkbox,
.tv-body #kc-form-options .checkbox label {
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--tv-ink-subtle);
}

.tv-body #kc-form-options .checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}

.tv-body #kc-form-options .checkbox input {
  position: static;
  margin: 0;
  accent-color: var(--tv-accent);
}

/* update-password: "Sign out from other devices" sits right above the button. */
.tv-body #kc-form-options + #kc-form-buttons {
  margin-top: 20px;
}

.tv-body .tv-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-body .tv-check__input {
  margin: 0;
  accent-color: var(--tv-accent);
}

.tv-body .tv-check__label {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--tv-ink-subtle);
}

/* Reset- and update-password put "Back to sign in" and the submit button in one
   settings row. Stack them: the button full width, the link centred beneath. */
.tv-body .tv-settings:has(#kc-form-buttons) {
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  margin: 6px 0 0;
}

.tv-body .tv-settings #kc-form-buttons {
  order: 1;
  margin: 0;
}

.tv-body .tv-settings #kc-form-options {
  order: 2;
  text-align: center;
}

.tv-body #kc-form-buttons {
  margin-top: 0;
}

.tv-body #kc-form-options span {
  display: inline;
}

/* ---------- Buttons ---------- */

.tv-body .tv-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  height: 44px;
  margin: 0;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--tv-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.tv-body .tv-button--primary {
  background: var(--tv-accent);
  color: hsl(40 20% 99%);
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.08), 0 1px 1px rgb(16 24 40 / 0.06);
}

.tv-body .tv-button--primary:hover,
.tv-body .tv-button--primary:focus {
  background: var(--tv-accent-hover);
  color: hsl(40 20% 99%);
}

.tv-body .tv-button--secondary {
  border-color: var(--tv-border);
  background: var(--tv-surface-raised);
  color: var(--tv-ink);
}

.tv-body .tv-button--secondary:hover,
.tv-body .tv-button--secondary:focus {
  border-color: var(--tv-border-strong);
  background: var(--tv-surface-muted);
  color: var(--tv-ink);
}

.tv-body .tv-button--block {
  display: flex;
  width: 100%;
}

.tv-body .tv-button:disabled,
.tv-body .tv-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---------- Identity providers ---------- */

.tv-body .tv-idp {
  margin-top: 24px;
}

.tv-body .tv-idp hr {
  display: none;
}

.tv-body .tv-idp h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-family: var(--tv-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tv-ink-muted);
}

.tv-body .tv-idp h2::before,
.tv-body .tv-idp h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tv-border);
}

.tv-body .tv-idp__list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv-body .tv-idp__logo {
  font-size: 16px;
}

/* ---------- Secondary links + info ---------- */

.tv-body .tv-alt-link {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
}

.tv-body .tv-body-content {
  display: flex;
  flex-direction: column;
}

.tv-body #kc-info-wrapper {
  padding: 0;
  background: none;
  font-size: inherit;
}

.tv-body[data-page-id="login-login-reset-password"] #kc-info {
  order: -1;
  margin: -16px 0 24px;
  padding: 0;
  border: 0;
  text-align: left;
  color: var(--tv-ink-subtle);
}

.tv-body .tv-info {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--tv-border);
  text-align: center;
  font-size: 14px;
  color: var(--tv-ink-muted);
}

.tv-body .tv-margin-top {
  margin-top: 16px;
}

.tv-body #kc-info-message .instruction {
  margin: 0 0 16px;
}

/* ---------- Icons (masks, so they take currentColor) ---------- */

.tv-body .tv-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: var(--tv-icon) center / contain no-repeat;
  mask: var(--tv-icon) center / contain no-repeat;
}

.tv-body .tv-icon--eye {
  --tv-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.tv-body .tv-icon--eye-off {
  --tv-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.6 5.1A10.8 10.8 0 0 1 12 5c6.4 0 10 7 10 7a17.6 17.6 0 0 1-2.8 3.7M6.6 6.6C3.7 8.4 2 12 2 12s3.6 7 10 7a9.8 9.8 0 0 0 5.4-1.6'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
}

.tv-body .tv-icon--alert {
  --tv-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5'/%3E%3Cpath d='M12 16.5h.01'/%3E%3C/svg%3E");
}

.tv-body .tv-icon--info {
  --tv-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5'/%3E%3Cpath d='M12 7.5h.01'/%3E%3C/svg%3E");
}

.tv-body .tv-icon--check {
  --tv-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.8 2.8L16 10'/%3E%3C/svg%3E");
}

.tv-body .tv-icon--restart {
  --tv-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .tv-body *,
  .tv-body *::before,
  .tv-body *::after {
    transition-duration: 0.01ms !important;
  }
}
