/* ============================================================
   SETTRIM — Componente de Login (Layout Dividido com Carrossel)
   ============================================================ */

:root {
  --login-bg-page: #070d1a;
  --login-bg-panel: #0f1828;
  --login-bg-panel-2: #121e33;
  --login-line: #1c2a44;
  --login-text-primary: #f5f7fb;
  --login-text-muted: #8a93a8;
  --login-accent-blue-1: #3b7dfb;
  --login-accent-blue-2: #1a4fd6;
  --login-accent-gold: #c9a463;
  --login-accent-gold-soft: rgba(201, 164, 99, 0.4);
  --login-input-bg: #ffffff;
  --login-input-text: #0e1524;
  --login-input-placeholder: #8a93a8;
  --login-focus-ring: rgba(59, 125, 251, 0.35);
}

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(59, 125, 251, 0.08), transparent 60%),
    radial-gradient(900px 500px at 85% 90%, rgba(26, 79, 214, 0.09), transparent 60%),
    var(--login-bg-page);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.login-container {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--login-bg-panel);
  border: 1px solid var(--login-line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  opacity: 0;
  transform: translateY(18px);
  animation: cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  position: relative;
  z-index: 2;
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- CARROSSEL ---------- */
.carousel {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background: #090e18;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 6s linear;
  will-change: opacity, transform;
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

.slide img,
.slide .art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 13, 26, 0) 55%, rgba(7, 13, 26, 0.6) 100%);
  pointer-events: none;
}

/* Ilustração — slide 2: diagrama técnico da frota */
.art-fleet {
  position: relative;
  background:
    radial-gradient(760px 420px at 68% 22%, rgba(59, 125, 251, 0.16), transparent 62%),
    linear-gradient(160deg, #060a12 0%, #0a111e 50%, #0c1524 100%);
}

.art-fleet .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(circle at 62% 42%, black 25%, transparent 72%);
  mask-image: radial-gradient(circle at 62% 42%, black 25%, transparent 72%);
  animation: gridPulse 6s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.art-fleet .scan {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 130px;
  background: linear-gradient(90deg, transparent, rgba(59, 125, 251, 0.16), transparent);
  animation: scanMove 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scanMove {
  0% { left: -15%; }
  100% { left: 105%; }
}

.art-fleet .diagram {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74%;
  max-width: 420px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 18px rgba(59, 125, 251, 0.22));
}

.art-fleet .diagram svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.art-fleet .blueprint-draw {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawLine 1.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

.art-fleet .tick-label {
  font-family: 'Inter', sans-serif;
  font-size: 6.5px;
  letter-spacing: 0.08em;
  fill: rgba(255, 255, 255, 0.4);
  opacity: 0;
  animation: fadeInLabel 0.6s ease forwards;
  animation-delay: 1.6s;
}

.art-fleet .tick-label.gold {
  fill: var(--login-accent-gold);
  fill-opacity: 0.85;
}

@keyframes fadeInLabel {
  to { opacity: 1; }
}

.art-fleet .measure-line {
  stroke: var(--login-accent-gold-soft);
  stroke-width: 0.8;
}

.art-fleet .measure-line.gold-line {
  stroke: var(--login-accent-gold);
  stroke-opacity: 0.6;
}

.art-fleet .wheel-spin {
  transform-origin: center;
  animation: wheelTick 4s linear infinite;
  animation-delay: 1.8s;
}

@keyframes wheelTick {
  0%, 92% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -18; }
}

.art-fleet .seal {
  opacity: 0;
  animation: fadeInLabel 0.8s ease forwards;
  animation-delay: 1.4s;
}

.art-fleet .seal-spin {
  transform-origin: center;
  transform-box: fill-box;
  animation: sealSpin 40s linear infinite;
}

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

/* Ilustração — slide 3: rede de cobertura no Triângulo Mineiro */
.art-map {
  position: relative;
  background:
    radial-gradient(560px 300px at 30% 78%, rgba(59, 125, 251, 0.22), transparent 62%),
    linear-gradient(160deg, #0a1120 0%, #0d1a2e 55%, #08101d 100%);
}

.art-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.art-map .region-outline {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawLine 2.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  animation-delay: 0.1s;
}

.art-map .route {
  stroke-dasharray: 5 7;
  opacity: 0;
  animation: routeIn 0.5s ease forwards, dashMove 2.8s linear infinite;
  animation-delay: 1.3s, 1.3s;
}

@keyframes routeIn {
  to { opacity: 0.55; }
}

@keyframes dashMove {
  to { stroke-dashoffset: -120; }
}

.art-map .node {
  opacity: 0;
  transform-origin: center;
  animation: nodeIn 0.5s ease forwards;
}

@keyframes nodeIn {
  to { opacity: 1; }
}

.art-map .node.hub {
  animation: nodeIn 0.5s ease forwards, hubPulse 2.4s ease-in-out infinite;
  animation-delay: 1s, 1.6s;
}

@keyframes hubPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(59, 125, 251, 0)); }
  50% { filter: drop-shadow(0 0 6px rgba(59, 125, 251, 0.7)); }
}

.art-map .city-label {
  font-family: 'Inter', sans-serif;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  fill: rgba(255, 255, 255, 0.82);
  opacity: 0;
  animation: fadeInLabel 0.5s ease forwards;
}

.art-map .city-label.sub {
  font-size: 7px;
  font-weight: 400;
  fill: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.art-map .city-label.gold {
  fill: var(--login-accent-gold);
}

.art-map .map-title {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  fill: var(--login-accent-gold);
  opacity: 0;
  animation: fadeInLabel 0.7s ease forwards;
  animation-delay: 0.3s;
}

.art-map .map-title.sub {
  font-size: 6.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  fill: rgba(255, 255, 255, 0.42);
  animation-delay: 0.55s;
}

.art-map .map-title-rule {
  stroke: var(--login-accent-gold);
  stroke-width: 0.7;
  stroke-opacity: 0.55;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawLine 1s ease forwards;
  animation-delay: 0.45s;
}

.art-map .seal-ring {
  transform-origin: center;
  transform-box: fill-box;
  opacity: 0;
  animation: fadeInLabel 0.6s ease forwards, sealSpinSlow 50s linear infinite;
  animation-delay: 1s, 1.6s;
}

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

/* Indicadores: pílula (ativo) e bolinha (inativo) */
.indicators {
  position: absolute;
  left: 32px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
}

.indicator {
  height: 8px;
  width: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease, opacity 0.4s ease;
  position: relative;
  overflow: hidden;
}

.indicator:hover {
  background: rgba(255, 255, 255, 0.6);
}

.indicator.is-active {
  width: 28px;
  background: rgba(255, 255, 255, 0.28);
}

.indicator.is-active .fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: #ffffff;
  border-radius: 999px;
  animation: fillBar 5s linear forwards;
}

@keyframes fillBar {
  from { width: 0%; }
  to { width: 100%; }
}

/* ---------- LADO DO FORMULÁRIO ---------- */
.panel {
  background: var(--login-bg-panel);
  padding: 64px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

h1.login-title {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--login-text-primary);
  margin: 0 0 36px 0;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
  animation-delay: 0.15s;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.field:nth-of-type(1) { animation-delay: 0.35s; }
.field:nth-of-type(2) { animation-delay: 0.42s; }

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

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--login-input-bg);
  border-radius: 12px;
  border: 1.5px solid transparent;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.input-wrap:focus-within {
  border-color: var(--login-accent-blue-1);
  box-shadow: 0 0 0 4px var(--login-focus-ring);
  transform: translateY(-1px);
}

.input-wrap svg.leading-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: #5b6478;
  pointer-events: none;
  transition: color 0.25s ease;
}

.input-wrap:focus-within svg.leading-icon {
  color: var(--login-accent-blue-2);
}

.input-wrap input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 16px 44px;
  font-size: 15px;
  color: var(--login-input-text);
  font-family: inherit;
  box-sizing: border-box;
}

.input-wrap input::placeholder {
  color: var(--login-input-placeholder);
}

.eye-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #5b6478;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.eye-btn:hover {
  color: var(--login-input-text);
  background: rgba(14, 21, 36, 0.06);
}

.eye-btn:active {
  transform: scale(0.88);
}

.eye-btn svg {
  width: 18px;
  height: 18px;
}

/* Botão Entrar com animações */
.btn-submit {
  position: relative;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--login-accent-blue-1) 0%, var(--login-accent-blue-2) 100%);
  background-size: 160% 100%;
  background-position: 0% 0%;
  overflow: hidden;
  isolation: isolate;
  transition: background-position 0.5s ease, transform 0.18s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 24px -10px rgba(26, 79, 214, 0.55);
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
  animation-delay: 0.48s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-submit:hover {
  background-position: 100% 0%;
  box-shadow: 0 14px 30px -10px rgba(26, 79, 214, 0.7);
  transform: translateY(-2px);
}

.btn-submit:active {
  transform: translateY(0) scale(0.98);
}

.btn-submit .btn-label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}


/* ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes rippleAnim {
  to { transform: scale(3); opacity: 0; }
}

/* loading state do botão */
.btn-submit.is-loading .btn-label {
  opacity: 0;
}

.btn-submit .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  opacity: 0;
  z-index: 2;
}

.btn-submit.is-loading .spinner {
  opacity: 1;
  animation: spin 0.7s linear infinite;
}

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

.login-error {
  margin-top: 6px;
  padding: 11px 16px;
  background: rgba(30, 10, 10, 0.85);
  border: 1.5px solid rgba(220, 60, 60, 0.7);
  border-radius: 10px;
  font-size: 0.87rem;
  color: #f87171;
  display: none;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login-error-icon {
  font-size: 1rem;
  color: inherit;
  flex-shrink: 0;
  line-height: 1;
}

.login-error-text {
  color: inherit;
  font-weight: inherit;
}

.footer-note {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--login-text-muted);
  text-align: center;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
  animation-delay: 0.58s;
}

/* Remove amarelo do autocomplete do browser */
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus,
.input-wrap input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--login-input-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--login-input-bg) inset !important;
  -webkit-text-fill-color: var(--login-input-text) !important;
  caret-color: var(--login-input-text);
  border-radius: 12px !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* ---------- RESPONSIVIDADE ---------- */

/* Tablets (portrait / landscape até ~1024px) */
@media (max-width: 1024px) {
  #login-screen { padding: 24px; }
  .login-container { max-width: 960px; grid-template-columns: 1fr 1fr; }
  .carousel { min-height: 480px; }
  .panel { padding: 48px 40px; }
  h1.login-title { font-size: 34px; margin-bottom: 28px; }
}

/* Tablets menores / retrato */
@media (max-width: 820px) {
  .login-container { grid-template-columns: 1fr; max-width: 520px; border-radius: 24px; }
  .carousel { min-height: 280px; }
  .panel { padding: 40px 36px; }
  h1.login-title { font-size: 30px; margin-bottom: 26px; }
  .indicators { left: 24px; bottom: 20px; }
}

/* Celulares */
@media (max-width: 480px) {
  #login-screen { padding: 12px; }
  .login-container { border-radius: 18px; max-width: 100%; }
  .carousel { min-height: 220px; }
  .panel { padding: 32px 20px; }
  h1.login-title { font-size: 26px; margin-bottom: 22px; }
  .input-wrap input { padding: 14px 42px; font-size: 14.5px; }
  .btn-submit { padding: 15px 18px; font-size: 14.5px; }
  .footer-note { margin-top: 26px; font-size: 11.5px; }
  .indicators { left: 18px; bottom: 16px; gap: 6px; }
  .indicator { height: 7px; width: 7px; }
  .indicator.is-active { width: 22px; }
}

/* Celulares bem pequenos (largura < 360px) */
@media (max-width: 360px) {
  .panel { padding: 26px 16px; }
  h1.login-title { font-size: 23px; }
  .carousel { min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
