/**
 * DressOn Administração - Estilos da página de login
 * Layout dividido: Esquerda (formulário) | Direita (marca)
 * Usa cores do sistema de design e fonte Inter
 */

/* ===================== ESTILOS BASE ===================== */
html[data-theme='dark'] body.login-page,
html body.login-page,
body.login-page {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: row !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  font-family:
    'neulis-sans',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden !important;
}

body.login-page #root {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  height: 100vh !important;
  min-height: 100vh !important;
}

/* ===================== LADO ESQUERDO - FORMULÁRIO DE LOGIN ===================== */
html[data-theme='dark'] .login-left,
.login-left {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  padding: 48px !important;
  min-height: 100vh !important;
  height: 100vh !important;
}

.login-form-container {
  width: 100%;
  max-width: 420px;
  animation: fadeInLeft 0.6s ease-out;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Logotipo */
.login-logo {
  display: flex;
  align-items: center;
  margin-bottom: 48px;
}

.login-logo-img {
  height: 48px;
  width: auto;
}

/* Texto de boas-vindas */
.login-welcome {
  margin-bottom: 40px;
}

.login-welcome h1 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.login-welcome p {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

/* Formulário */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form .form-group.floating {
  position: relative;
  margin-top: 12px;
}

.login-form .form-group.floating:first-child {
  margin-top: 0;
}

.login-form .form-group.floating .form-input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  font-size: 16px;
  font-family: inherit;
  color: #1f2937;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-form .form-group.floating .form-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 500;
  color: #9ca3af;
  pointer-events: none;
  transition: all 0.2s ease;
  background: transparent;
  padding: 0 4px;
}

/* Animação do rótulo ao focar/ter valor */
.login-form .form-group.floating .form-input:focus ~ .form-label,
.login-form .form-group.floating.has-value .form-label {
  top: 0;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 600;
  color: #0fb9b1;
  background: #ffffff;
}

.login-form .form-group.floating.has-value .form-label {
  color: #6b7280;
}

.login-form .form-group.floating .form-input:focus ~ .form-label {
  color: #0fb9b1;
}

.login-form .form-group.floating .form-input:hover {
  border-color: #d1d5db;
}

.login-form .form-group.floating .form-input:focus {
  background: #ffffff;
  border-color: #0fb9b1;
  box-shadow: 0 0 0 4px rgba(15, 185, 177, 0.1);
}

/* Alternância de senha */
.login-form .form-group.floating .form-input--password {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #0fb9b1;
}

/* Mensagem de erro */
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  color: #dc2626;
  display: none;
  align-items: center;
  gap: 10px;
  animation: shake 0.4s ease;
}

.login-error.show {
  display: flex;
  margin-bottom: 24px;
}

.login-error-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

/* Opções de login */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
}

/* Caixa de seleção personalizada */
.login-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.login-checkbox input {
  display: none;
}

.login-checkbox__mark {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: #f9fafb;
  flex-shrink: 0;
}

.login-checkbox:hover .login-checkbox__mark {
  border-color: #0fb9b1;
}

.login-checkbox input:checked + .login-checkbox__mark {
  background: #0fb9b1;
  border-color: #0fb9b1;
}

.login-checkbox input:checked + .login-checkbox__mark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.login-checkbox__label {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* Botão de envio */
.login-btn {
  width: 100%;
  height: 56px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, #0fb9b1 0%, #0a9590 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px -2px rgba(15, 185, 177, 0.35);
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(15, 185, 177, 0.45);
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Indicador de carregamento */
.login-spinner-icon {
  animation: spin 0.8s linear infinite;
}

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

/* Aviso de segurança */
.login-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  font-size: 13px;
  color: #9ca3af;
}

.login-security svg {
  color: #22c55e;
  flex-shrink: 0;
}

/* Rodapé */
.login-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #f3f4f6;
  text-align: center;
}

.login-footer p {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
}

/* ===================== LADO DIREITO - MARCA ===================== */
html[data-theme='dark'] .login-right,
.login-right {
  flex: 1 !important;
  background: linear-gradient(135deg, #0e1b2a 0%, #162435 100%) !important;
  background-color: #0e1b2a !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 48px !important;
  position: relative !important;
  overflow: hidden !important;
  min-height: 100vh !important;
  height: 100vh !important;
}

/* Fundo com formas flutuantes */
.floating-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  background: rgba(15, 185, 177, 0.15);
  border-radius: 50%;
  animation: float 20s infinite ease-in-out;
}

.shape-1 {
  width: 350px;
  height: 350px;
  top: -80px;
  right: -80px;
  animation-delay: 0s;
}

.shape-2 {
  width: 250px;
  height: 250px;
  bottom: 5%;
  left: -50px;
  animation-delay: -5s;
}

.shape-3 {
  width: 180px;
  height: 180px;
  top: 35%;
  right: 15%;
  animation-delay: -10s;
}

.shape-4 {
  width: 120px;
  height: 120px;
  bottom: 25%;
  right: 8%;
  animation-delay: -15s;
}

.shape-5 {
  width: 100px;
  height: 100px;
  top: 15%;
  left: 15%;
  animation-delay: -7s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-25px) rotate(5deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(25px) rotate(-5deg);
  }
}

/* Conteúdo do lado direito */
.login-right-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #ffffff !important;
  max-width: 480px;
  animation: fadeInRight 0.8s ease-out 0.2s backwards;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.login-right-logo {
  margin: 0 auto 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-right-logo img {
  height: 64px;
  width: auto;
}

.login-right-content h2 {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.5px;
  color: #ffffff !important;
  line-height: 1.2;
}

.login-right-content p {
  font-size: 18px;
  opacity: 0.9;
  line-height: 1.6;
  margin: 0 0 40px;
  color: #ffffff !important;
}

/* Lista de recursos */
.login-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(15, 185, 177, 0.1);
  border-radius: 14px;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  border: 1px solid rgba(15, 185, 177, 0.2);
}

.login-feature:hover {
  background: rgba(15, 185, 177, 0.2);
  transform: translateX(6px);
  border-color: rgba(15, 185, 177, 0.4);
}

.login-feature-icon {
  width: 44px;
  height: 44px;
  background: rgba(15, 185, 177, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-feature-icon svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

.login-feature span {
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
}

/* ===================== RESPONSIVO ===================== */
@media (max-width: 1200px) {
  .login-right-content {
    max-width: 400px;
  }

  .login-right-logo {
    margin-bottom: 32px;
  }

  .login-right-logo img {
    height: 56px;
  }

  .login-right-content h2 {
    font-size: 30px;
  }

  .login-right-content p {
    font-size: 16px;
    margin-bottom: 32px;
  }
}

/* Tablet e Mobile - esconde o painel de marca */
@media (max-width: 1024px) {
  html body.login-page,
  body.login-page {
    flex-direction: column !important;
  }

  body.login-page #root {
    flex-direction: column !important;
  }

  .login-right {
    display: none !important;
  }

  .login-left {
    width: 100% !important;
    flex: none !important;
    min-height: 100vh !important;
    height: auto !important;
    overflow-y: auto !important;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%) !important;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .login-left {
    padding: 32px 24px !important;
    align-items: flex-start !important;
    padding-top: 48px !important;
  }

  .login-form-container {
    max-width: 100%;
    width: 100%;
  }

  .login-logo {
    margin-bottom: 32px;
  }

  .login-logo-img {
    height: 40px;
  }

  .login-welcome {
    margin-bottom: 28px;
  }

  .login-welcome h1 {
    font-size: 26px;
  }

  .login-welcome p {
    font-size: 15px;
  }

  .login-form .form-group.floating .form-input,
  .login-btn {
    height: 52px;
  }

  .login-footer {
    margin-top: 32px;
  }

  .login-security {
    margin-top: 24px;
  }
}

/* Mobile pequeno */
@media (max-width: 380px) {
  .login-left {
    padding: 24px 16px !important;
    padding-top: 40px !important;
  }

  .login-welcome h1 {
    font-size: 22px;
  }

  .login-welcome p {
    font-size: 14px;
  }

  .login-form .form-group.floating .form-input,
  .login-btn {
    height: 48px;
    font-size: 15px;
  }

  .login-form .form-group.floating .form-label {
    font-size: 15px;
  }

  .login-options {
    margin: 16px 0;
  }

  .login-checkbox__label {
    font-size: 13px;
  }

  .login-footer {
    margin-top: 24px;
    padding-top: 20px;
  }
}

/* ===================== SUPORTE A MODO ESCURO ===================== */
/* Nota: A página de login permanece clara de propósito para manter a consistência da marca */
