/*
 * Telas de acesso (login e definição de senha): painel da marca à esquerda, formulário à direita.
 * Compartilhado por Views/Autenticacao/Login.cshtml e ResetPassword.cshtml. Essas telas têm layout
 * próprio (Layout = null) e não usam o shell; os valores ficam nas variáveis abaixo.
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #163a59;
  --navy-hover:  #0f2d45;
  --cyan:        #00aeef;
  --cyan-hover:  #009fd8;
  --cyan-glow:   rgba(0,174,239,.18);
  --text:        #1e293b;
  --muted:       #64748b;
  --border:      #e8ecf2;
  --bg-page:     #eef2f7;
  --bg-subtle:   #f4f6fb;
  --surface:     #ffffff;
  --error:       #dc2626;
  --success:     #16a34a;
  --radius:      8px;
}

html, body { height: 100%; font-family: 'Inter', sans-serif; }

body {
  display: flex;
  background: var(--bg-page);
  min-height: 100vh;
  overflow: hidden;
}

/* ══ LEFT ══ */
.side-brand {
  flex: 1;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.side-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.arc {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,174,239,.12);
  pointer-events: none;
}
.arc-1 { width: 560px; height: 560px; top: -180px; left: -180px; }
.arc-2 { width: 380px; height: 380px; bottom: -100px; right: -120px; }
.arc-3 { width: 200px; height: 200px; bottom: 120px; right: 60px; border-color: rgba(0,174,239,.07); }

.brand-identity {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 1;
  padding: 48px;
}

.brand-logo-main {
  width: 100%;
  max-width: 320px;
  background: rgb(255 255 255);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 40px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18), 0 0 0 1px rgba(0,174,239,.1);
}

.brand-logo-main img {
  max-height: 80px;
  max-width: 100%;
  object-fit: contain;
}

.brand-name-main {
  font-size: 28px; font-weight: 700;
  color: #ffffff;
  letter-spacing: .1em;
}

.brand-divider {
  width: 32px; height: 1px;
  background: rgba(0,174,239,.4);
  display: block;
}

.brand-sub {
  font-size: 13px; font-weight: 400;
  color: rgba(255,255,255,.35);
  letter-spacing: .04em;
}

.brand-footer {
  font-size: 12px;
  color: rgba(255,255,255,.22);
  position: absolute;
  bottom: 32px; left: 52px;
  z-index: 1;
}

/* ══ RIGHT ══ */
.side-form {
  width: min(460px, 100%);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 48px;
  position: relative;
  box-shadow: -8px 0 40px rgba(15,21,40,.08);
}

.mobile-brand {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.mobile-brand-logo {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 36px;
  box-shadow: 0 8px 28px rgba(22,58,89,.2);
}
.mobile-brand-logo img {
  max-height: 64px;
  max-width: 100%;
  object-fit: contain;
}
.mobile-brand-name {
  font-size: 18px; font-weight: 700;
  color: var(--navy);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.mobile-brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-top: -6px;
}

.screen { display: none; }
.screen.active { display: block; animation: fadeUp .3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-head { margin-bottom: 32px; }
.form-head h2 { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.form-head p  { font-size: 14px; color: var(--muted); }

.msg-banner {
  display: none;
  align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  line-height: 1.45;
  margin-bottom: 18px;
}
.msg-banner svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
.msg-banner.is-error   { background: #fef2f2; border: 1px solid #fecaca; color: var(--error); display: flex; }
.msg-banner.is-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); display: flex; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-wrap { position: relative; }

.field-wrap .f-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: #b0bec5;
  pointer-events: none;
  transition: color .18s;
}
.field-wrap:focus-within .f-icon { color: var(--cyan); }

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%; height: 44px;
  padding: 0 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg-subtle);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder { color: #b8c2cc; }
input:focus {
  border-color: var(--cyan);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}
input.is-invalid { border-color: var(--error); }
input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.1); }

.field-err { display: none; font-size: 12px; color: var(--error); margin-top: 5px; }
.field-err.show { display: block; }

.campo-olho {
  position: absolute; right: 13px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; padding: 0;
  color: #b0bec5;
  display: flex; align-items: center;
  transition: color .18s;
}
.campo-olho:hover { color: var(--muted); }
.campo-olho svg { width: 16px; height: 16px; }

.row-options {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: -10px; margin-bottom: 24px;
}

.remember-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  cursor: pointer; user-select: none;
}
.remember-label input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.remember-box {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.remember-label input:checked + .remember-box {
  background: var(--navy); border-color: var(--navy);
}
.remember-label input:checked + .remember-box::after {
  content: '';
  display: block;
  width: 9px; height: 5px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}

.link-subtle {
  font-size: 13px; font-weight: 500;
  color: var(--cyan-hover);
  cursor: pointer; background: none; border: none;
  padding: 0; text-decoration: none;
  transition: color .18s;
}
.link-subtle:hover { color: var(--cyan); }

.btn-submit {
  width: 100%; height: 46px;
  background: var(--navy);
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: #ffffff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .18s, box-shadow .18s, transform .1s;
}
.btn-submit:hover { background: var(--navy-hover); box-shadow: 0 4px 18px rgba(22,58,89,.28); }
.btn-submit:active { transform: scale(.98); }
.btn-submit.loading { pointer-events: none; opacity: .85; }
.btn-submit .spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: none;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-label,
.btn-submit.loading .btn-arrow { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.step-dots { display: flex; gap: 6px; margin-bottom: 28px; }
.step-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border);
  transition: background .2s, width .2s;
}
.step-dot.active { background: var(--cyan); width: 20px; border-radius: 3px; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  cursor: pointer; background: none; border: none; padding: 0;
  margin-top: 20px;
  transition: color .18s;
}
.back-link:hover { color: var(--navy); }
.back-link svg { width: 14px; height: 14px; }

.repasys-footer {
  position: absolute;
  bottom: 28px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.repasys-footer img {
  height: 18px; width: auto;
  opacity: 0.45;
  filter: grayscale(1);
}
.repasys-footer span {
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0.6;
}

@media (max-width: 780px) {
  body { overflow-y: auto; }
  .side-brand { display: none; }
  .side-form {
    width: 100%;
    padding: 48px 28px 80px;
    justify-content: flex-start;
    min-height: 100vh;
  }
  .mobile-brand { display: flex; }
  .repasys-footer { bottom: 20px; }
}

/* ── Definir senha: requisitos, erros do servidor e leitor de tela ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Erro de campo devolvido pelo servidor (ValidationMessageFor) */
.field-err.field-validation-error { display: block; }

/* Checklist de requisitos (.shell-requisitos) com a tipografia e a margem das telas de acesso */
.side-form .shell-requisitos {
  font-family: 'Inter', sans-serif;
  margin-top: 10px;
  margin-bottom: 18px;
}

/* Campo com ícone de senha: mantém o espaço do olho à direita */
.field-wrap input[type="password"],
.field-wrap input[type="text"] { padding-right: 40px; }

.link-voltar { text-decoration: none; }
