/* ---------- Variáveis ---------- */
:root {
  --deep: #0B3D3D;
  --teal: #1A6B6B;
  --teal-mid: #2A8080;
  --teal-lt: #4DB8B8;
  --teal-bg: #F0F8F8;
  --teal-rim: #C8E6E6;
  --white: #FFFFFF;
  --text-dark: #0B2E2E;
  --text-mid: #3D5C5C;
  --text-muted: #7A8C8C;
  --text-ph: #AABFBF;
  --border: #D4E0E0;
  --err-bg: #FEF2F2;
  --err-bd: #FCA5A5;
  --err-tx: #991B1B;
  --err-ic: #EF4444;
  --font: 'Inter', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 24px 64px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .07);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--deep);
}

/* ============================================================
   FUNDO COM IMAGEM
   ============================================================ */
.bg-image-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('../images/logos/bg_login.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-image-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: brightness(.5) saturate(1.1);
  z-index: -1;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(11, 61, 61, .80) 0%,
      rgba(26, 107, 107, .70) 60%,
      rgba(11, 61, 61, .82) 100%);
}

/* ============================================================
   PARTÍCULAS FLUTUANTES
   ============================================================ */
.floating-icons {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.fi {
  position: absolute;
  color: var(--teal-lt);
  opacity: 0;
  font-size: 36px;
  animation: floatUp 22s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(77, 184, 184, .25));
}

.fi-1 {
  top: 15%;
  left: 6%;
  animation-delay: 0s;
  animation-duration: 26s;
  font-size: 40px;
}

.fi-2 {
  top: 65%;
  left: 88%;
  animation-delay: 3s;
  animation-duration: 22s;
  font-size: 32px;
}

.fi-3 {
  top: 40%;
  left: 82%;
  animation-delay: 1.5s;
  animation-duration: 19s;
  font-size: 30px;
}

.fi-4 {
  top: 78%;
  left: 12%;
  animation-delay: 5s;
  animation-duration: 24s;
  font-size: 34px;
}

.fi-5 {
  top: 22%;
  left: 74%;
  animation-delay: 2s;
  animation-duration: 21s;
  font-size: 36px;
}

.fi-6 {
  top: 55%;
  left: 18%;
  animation-delay: 4s;
  animation-duration: 20s;
  font-size: 28px;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg);
  }

  10% {
    opacity: .18;
  }

  50% {
    opacity: .28;
    transform: translate(25px, -90px) rotate(18deg);
  }

  90% {
    opacity: .12;
  }

  100% {
    opacity: 0;
    transform: translate(-40px, -160px) rotate(40deg);
  }
}

/* ============================================================
   CONTENTOR CENTRAL
   ============================================================ */
.page-center {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

/* ============================================================
   CARD PRINCIPAL
   ============================================================ */
.login-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 980px;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: slideUp .7s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   LADO ESQUERDO — BRANDING
   ============================================================ */
.card-left {
  background: var(--deep);
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Círculos decorativos */
.card-left::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 107, 107, .4) 0%, transparent 70%);
}

.card-left::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 184, 184, .2) 0%, transparent 70%);
}

.brand-top {
  position: relative;
  z-index: 1;
}

.brand-logo {
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 10px;
}

.brand-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, .58);
  line-height: 1.6;
}

/* Lista de funcionalidades */
.feat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 36px;
  position: relative;
  z-index: 1;
}

.feat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  transition: background .25s, transform .25s;
  cursor: default;
}

.feat-item:hover {
  background: rgba(255, 255, 255, .11);
  transform: translateX(6px);
}

.feat-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(77, 184, 184, .18);
  flex-shrink: 0;
}

.feat-icon i {
  font-size: 15px;
  color: var(--teal-lt);
}

.feat-item>span:last-child {
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
  font-weight: 500;
}

.brand-copy {
  font-size: 11px;
  color: rgba(255, 255, 255, .28);
  margin-top: auto;
  padding-top: 32px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   LADO DIREITO — FORMULÁRIO
   ============================================================ */
.card-right {
  background: var(--white);
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Cabeçalho do formulário */
.form-header {
  margin-bottom: 32px;
}

.form-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}

.form-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Caixa de alerta */
.alert-box {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--err-bg);
  border: 1px solid var(--err-bd);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--err-tx);
  margin-bottom: 20px;
  animation: fadeDown .35s ease both;
}

.alert-box.show {
  display: flex;
}

.alert-box i {
  font-size: 16px;
  color: var(--err-ic);
  flex-shrink: 0;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Formulário */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Grupo de campo */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  font-size: 15px;
  color: var(--text-ph);
  transition: color .2s;
  pointer-events: none;
}

.field-input {
  width: 100%;
  padding: 12px 44px 12px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-dark);
  background: var(--teal-bg);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.field-input::placeholder {
  color: var(--text-ph);
}

.field-input:focus {
  border-color: var(--teal);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26, 107, 107, .12);
}

.field-input:focus+.field-icon,
.field-wrap:focus-within .field-icon {
  color: var(--teal);
}

/* Toggle de password */
.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-ph);
  transition: color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.toggle-pw:hover {
  color: var(--teal);
}

/* Opções do formulário */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
  user-select: none;
}

.remember-check {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  cursor: pointer;
}

/* Botão de submissão */
.btn-submit {
  position: relative;
  padding: 14px 20px;
  background: var(--deep);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .25s, transform .15s, box-shadow .25s;
  overflow: hidden;
  margin-top: 4px;
}

.btn-submit:hover {
  background: var(--teal);
  box-shadow: 0 8px 24px rgba(26, 107, 107, .35);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 14px;
  transition: transform .2s;
}

.btn-submit:hover .btn-icon {
  transform: translateX(3px);
}

/* Estado loading */
.btn-submit.loading .btn-text,
.btn-submit.loading .btn-icon {
  opacity: 0;
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  position: absolute;
}

.btn-submit.loading .btn-spinner {
  display: block;
}

.btn-submit.loading {
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 860px) {
  .login-card {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .card-left {
    padding: 36px 32px;
  }

  .feat-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .feat-item {
    flex: 1 1 calc(50% - 5px);
  }

  .brand-copy {
    display: none;
  }
}

@media (max-width: 520px) {
  .card-left {
    padding: 28px 20px;
  }

  .card-right {
    padding: 32px 20px;
  }

  .feat-item {
    flex: 1 1 100%;
  }

  .form-title {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}