/* =========================================================
   LinkValore — tema base de login (Keycloak)
   Split editorial: painel de marca + formulário.
   Cada tema-filho redefine apenas as variáveis de marca.
   ========================================================= */

:root {
  /* marca (sobrescrito por brand.css) */
  --brand:        #2348D9;
  --brand-2:      #4A6BF0;
  --ink:          #0E1430;
  --ink-2:        #1A2350;

  /* superfícies */
  --bg:           #F5F6FA;
  --surface:      #FFFFFF;
  --text:         #171B2B;
  --muted:        #6B7186;
  --faint:        #9AA0B4;
  --border:       #E2E5EE;
  --field:        #FFFFFF;

  /* tipografia */
  --font-display: 'Montserrat', ui-sans-serif, sans-serif;
  --font-body:    'Kanit', ui-sans-serif, sans-serif;

  --radius:       12px;
  --ring:         rgba(35, 72, 217, 0.18);
  --logo-h:       58px;
  --brand-logo-filter: none;
}

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

html.lv-html, body.lv-body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
}

body.lv-body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.lv-shell {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* =========================================================
   PAINEL DE MARCA
   ========================================================= */
.lv-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(38px, 4.6vw, 64px);
  background:
    radial-gradient(130% 100% at 12% 8%, var(--ink-2) 0%, var(--ink) 58%, #05070F 100%);
  color: #fff;
  isolation: isolate;
}

/* grade fina tipo papel de projeto / razão contábil */
.lv-brand-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(78% 62% at 30% 24%, #000 0%, transparent 78%);
          mask-image: radial-gradient(78% 62% at 30% 24%, #000 0%, transparent 78%);
  z-index: -2;
}

/* halo da cor da marca */
.lv-brand-glow {
  position: absolute;
  width: 62vw;
  height: 62vw;
  right: -22vw;
  bottom: -30vw;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand) 0%, transparent 62%);
  opacity: 0.30;
  filter: blur(18px);
  z-index: -1;
  animation: lv-breathe 14s ease-in-out infinite;
}

@keyframes lv-breathe {
  0%, 100% { transform: scale(1);    opacity: 0.28; }
  50%      { transform: scale(1.08); opacity: 0.38; }
}

.lv-brand-top { position: relative; }

.lv-brand-logo {
  height: var(--logo-h);
  width: auto;
  max-width: 260px;
  object-fit: contain;
  filter: var(--brand-logo-filter);
}

.lv-brand-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lv-brand-mid { position: relative; max-width: 30ch; }

.lv-brand-tagline {
  font-family: var(--font-display);
  font-size: clamp(27px, 2.9vw, 41px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: #fff;
}

.lv-brand-tagline em {
  font-style: normal;
  color: var(--brand);
  filter: brightness(1.35);
}

.lv-brand-rule {
  width: 62px;
  height: 3px;
  margin: 26px 0 18px;
  background: var(--brand);
  border-radius: 2px;
}

.lv-brand-portal {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
}

.lv-brand-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.45);
}

.lv-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #35C87A;
  box-shadow: 0 0 0 0 rgba(53, 200, 122, 0.55);
  animation: lv-pulse 2.6s ease-out infinite;
  flex: none;
}

@keyframes lv-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(53, 200, 122, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(53, 200, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 200, 122, 0); }
}

/* =========================================================
   PAINEL DO FORMULÁRIO
   ========================================================= */
.lv-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 56px);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(0,0,0,0.028) 0%, transparent 62%),
    var(--bg);
}

.lv-card {
  width: 100%;
  max-width: 396px;
}

/* cabeçalho de marca dentro do card — só aparece no mobile */
.lv-card-head { display: none; }

.lv-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 26px;
  color: var(--text);
}

.lv-form { display: block; }

.lv-field { margin-bottom: 16px; }

.lv-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.lv-input,
.lv-form-area input[type="text"],
.lv-form-area input[type="email"],
.lv-form-area input[type="password"],
.lv-form-area select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  appearance: none;
}

.lv-input::placeholder { color: var(--faint); }

.lv-input:hover,
.lv-form-area input[type="text"]:hover,
.lv-form-area input[type="password"]:hover { border-color: #CFD4E2; }

.lv-input:focus,
.lv-form-area input[type="text"]:focus,
.lv-form-area input[type="email"]:focus,
.lv-form-area input[type="password"]:focus,
.lv-form-area select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--surface);
}

.lv-input[aria-invalid="true"] { border-color: #E0524C; }

.lv-input--code {
  letter-spacing: 0.42em;
  font-size: 19px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lv-input-wrap { position: relative; }
.lv-input-wrap .lv-input { padding-right: 46px; }

.lv-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.lv-eye:hover { color: var(--muted); background: rgba(0,0,0,0.04); }
.lv-eye.is-on { color: var(--brand); }

.lv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
  min-height: 22px;
}

.lv-row--empty { margin: 0 0 10px; min-height: 0; }

.lv-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.lv-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
  margin: 0;
}

.lv-link,
.lv-form-area a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.lv-link:hover,
.lv-form-area a:hover { color: var(--brand); border-bottom-color: var(--brand); }

.lv-link--btn {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

/* botão principal */
.lv-btn,
.lv-form-area input[type="submit"],
.lv-form-area button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 6px 18px -8px var(--brand);
}

.lv-btn:hover,
.lv-form-area input[type="submit"]:hover,
.lv-form-area button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -10px var(--brand);
  filter: saturate(1.06);
}
.lv-btn:active { transform: translateY(0); }
.lv-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.lv-btn svg { flex: none; }

/* alertas e erros */
.lv-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  margin: 0 0 18px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid;
}

.lv-alert-icon {
  flex: none;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

.lv-alert--error   { background: #FDF1F0; border-color: #F3CFCC; color: #99332C; }
.lv-alert--error   .lv-alert-icon { background: #D9453C; }
.lv-alert--warning { background: #FEF7EC; border-color: #F3DFBD; color: #8A6218; }
.lv-alert--warning .lv-alert-icon { background: #D89A2B; }
.lv-alert--success { background: #EFF9F3; border-color: #C7E7D6; color: #1F6B45; }
.lv-alert--success .lv-alert-icon { background: #2E9E63; }
.lv-alert--info    { background: #F0F4FD; border-color: #D3DEF7; color: #2C4A8C; }
.lv-alert--info    .lv-alert-icon { background: #4C74D9; }

.lv-field-error {
  display: block;
  margin-top: 7px;
  font-size: 12.5px;
  color: #C0392F;
}

.lv-required-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.lv-req { color: #D9453C; }

/* info / rodapé */
.lv-info,
.lv-back {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.lv-info-text { margin: 0; line-height: 1.55; }

.lv-another-way { margin-top: 18px; text-align: center; }

/* no desktop o aviso legal vive no painel de marca; no card só aparece no mobile */
.lv-legal { display: none; }

@media (max-width: 900px) {
  .lv-legal { display: block; }
}

.lv-legal {
  margin: 34px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.5;
  color: var(--faint);
  letter-spacing: 0.02em;
}

/* provedores sociais / IdP */
.lv-sep {
  position: relative;
  text-align: center;
  margin: 24px 0 16px;
}
.lv-sep::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--border);
}
.lv-sep span {
  position: relative;
  background: var(--bg);
  padding: 0 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.lv-social-list { display: grid; gap: 8px; }

.lv-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text) !important;
  font-size: 14px;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.lv-social-btn:hover { border-color: var(--brand); background: var(--surface); }

/* seletor de OTP */
.lv-otp-picker { display: grid; gap: 8px; margin-bottom: 16px; }
.lv-otp-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
}
.lv-otp-option input { accent-color: var(--brand); }

/* fallback para páginas herdadas do tema padrão (PatternFly ausente) */
.lv-form-area ul { padding-left: 18px; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.lv-form-area li { margin-bottom: 6px; }
.lv-form-area label { font-size: 13px; color: var(--muted); }
.lv-form-area p  { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 0 14px; }
.lv-form-area img { max-width: 100%; height: auto; }
.lv-form-area .pf-c-button,
.lv-form-area input[type="button"] {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 18px; margin-top: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}

/* entrada em cascata */
.lv-brand-top   { animation: lv-rise .55s cubic-bezier(.2,.7,.3,1) both; }
.lv-brand-mid   { animation: lv-rise .55s cubic-bezier(.2,.7,.3,1) .08s both; }
.lv-brand-foot  { animation: lv-rise .55s cubic-bezier(.2,.7,.3,1) .16s both; }
.lv-title       { animation: lv-rise .5s cubic-bezier(.2,.7,.3,1) .06s both; }
.lv-form-area   { animation: lv-rise .5s cubic-bezier(.2,.7,.3,1) .13s both; }
.lv-legal       { animation: lv-rise .5s cubic-bezier(.2,.7,.3,1) .2s both; }

@keyframes lv-rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 900px) {
  .lv-shell { grid-template-columns: 1fr; }
  .lv-brand { display: none; }

  .lv-main {
    align-items: flex-start;
    padding: 40px 22px 32px;
    background: var(--bg);
  }

  .lv-card { max-width: 420px; margin: 0 auto; }

  .lv-card-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
  }
  .lv-card-logo { height: 46px; width: auto; max-width: 210px; object-fit: contain; align-self: flex-start; }
  .lv-card-wordmark {
    font-family: var(--font-display);
    font-weight: 800; font-size: 20px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text);
  }
  .lv-card-sub {
    font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  }
}

@media (max-width: 380px) {
  .lv-title { font-size: 22px; }
}
