/* =========================================================
   Heimdall — Login
   CSS independente (não depende do panel.css)
   Paleta extraída do logo:
     anel     #19BDE0
     íris     #0E9CB5
     fundo    #06181E (tinta profunda, "vigília noturna")
     papel    #F6FBFC (lado do formulário)
   ========================================================= */

:root {
  --teal:        #19BDE0;
  --teal-deep:   #0E9CB5;
  --teal-dark:   #0A7A8F;
  --ink:         #06181E;
  --ink-2:       #0A222B;
  --paper:       #F6FBFC;
  --text:        #10242B;
  --muted:       #5B7480;
  --line:        #D7E4E8;
  --error-bg:    #FDECEC;
  --error-text:  #B3261E;
  --radius:      14px;
  --font-body:   "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display:"Bricolage Grotesque", "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body.login {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
}

/* ---------- Estrutura em dois painéis ---------- */

.shell {
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Painel da marca ---------- */

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 32px;
  background:
    radial-gradient(circle at 50% 38%, rgba(25, 189, 224, 0.10), transparent 55%),
    radial-gradient(circle at 50% 38%, rgba(25, 189, 224, 0.05), transparent 75%),
    linear-gradient(180deg, var(--ink-2) 0%, var(--ink) 70%);
  overflow: hidden;
}

/* anéis concêntricos bem sutis ecoando o logo */
.brand::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: repeating-radial-gradient(
    circle at 50% 42%,
    rgba(25, 189, 224, 0.045) 0 1px,
    transparent 1px 90px
  );
  pointer-events: none;
}

.brand-inner {
  position: relative;
  text-align: center;
}

.eye-wrap {
  position: relative;
  width: clamp(150px, 22vw, 230px);
  margin: 0 auto 28px;
}

.eye {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

.eye-glow {
  position: absolute;
  inset: -25%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 189, 224, 0.22), transparent 60%);
  filter: blur(6px);
  z-index: 0;
  transition: opacity 0.4s ease;
}

/* íris: achata ao "fechar o olho" */
.eye-iris {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: transform 0.28s cubic-bezier(0.55, 0, 0.3, 1.4);
}

/* pupila: raio anima ao fechar (suportado nos navegadores modernos) */
#eyePupil {
  transition: r 0.22s ease, cx 0.08s linear, cy 0.08s linear;
}

.eye--closed .eye-iris { transform: scaleY(0.07); }
.eye--closed #eyePupil { r: 0; }
.eye--closed ~ .eye-glow,
.eye-wrap:has(.eye--closed) .eye-glow { opacity: 0.35; }

.brand-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 52px);
  letter-spacing: -0.01em;
  color: #EAF7FA;
}

.brand-status {
  margin: 14px auto 0;
  max-width: 30ch;
  min-height: 1.4em;
  font-size: 15px;
  color: rgba(234, 247, 250, 0.62);
  transition: opacity 0.2s ease;
}

.brand-status.is-swapping { opacity: 0; }

.brand-foot {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(234, 247, 250, 0.32);
  padding: 0 24px;
}

/* ---------- Painel do formulário ---------- */

.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: 48px 24px;
}

.panel-inner {
  width: 100%;
  max-width: 380px;
  animation: rise 0.5s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.login-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.login-sub {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--muted);
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid rgba(179, 38, 30, 0.18);
}

.form-group {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.form-label {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.form-input {
  min-height: 44px;
  width: 100%;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(180deg, #fff 0%, #F9FCFD 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  box-shadow: 0 1px 3px rgba(6, 24, 30, .06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-input::placeholder { color: #A8BCC4; }

.form-input:hover {
  border-color: rgba(25, 189, 224, .45);
}

.form-input:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(25, 189, 224, 0.16), 0 1px 3px rgba(6, 24, 30, .06);
}

/* senha + botão de mostrar */
.password-wrapper { position: relative; }

.password-wrapper .form-input { padding-right: 46px; }

.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: #93A8B1;
  transition: color 0.18s ease, background 0.18s ease;
}

.toggle-password:hover {
  color: var(--teal-dark);
  background: rgba(25, 189, 224, 0.10);
}

.toggle-password:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 2px;
}

.toggle-password svg { pointer-events: none; }
.toggle-password .ico-eye-off { display: none; }
.toggle-password.is-visible .ico-eye { display: none; }
.toggle-password.is-visible .ico-eye-off { display: block; }

.field-hint {
  margin: 8px 2px 0;
  font-size: 13px;
  color: var(--teal-dark);
}

/* botão entrar */
.btn-enter {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: #04272E;
  background: linear-gradient(180deg, var(--teal) 0%, #14AECF 100%);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 6px 18px rgba(25, 189, 224, 0.28);
}

.btn-enter:hover  { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(25, 189, 224, 0.36); }
.btn-enter:active { transform: translateY(1px); }

.btn-enter:focus-visible {
  outline: 3px solid var(--teal-dark);
  outline-offset: 2px;
}

.forgot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
}

.forgot a {
  color: var(--teal-dark);
  font-weight: 500;
  text-decoration: none;
}

.forgot a:hover { text-decoration: underline; }

/* ---------- Responsivo ---------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }

  .brand {
    min-height: auto;
    padding: 36px 24px 28px;
  }

  .eye-wrap { width: 120px; margin-bottom: 18px; }
  .brand-name { font-size: 30px; }
  .brand-status { font-size: 14px; }
  .brand-foot { display: none; }

  .panel { padding: 32px 20px 48px; }
}

/* ---------- Movimento reduzido ---------- */

@media (prefers-reduced-motion: reduce) {
  .panel-inner { animation: none; }
  .eye-iris,
  #eyePupil,
  .brand-status,
  .btn-enter { transition: none; }
}
