/* ============================================
   FLOWDESK — AUTH STYLES
   ============================================ */

.view-login-wrapper {
  --login-accent:       var(--accent);
  --login-accent-hover: var(--accent-hover);
  --login-bg:           #000;
  --login-line:         rgba(255, 255, 255, 0.14);

  position: fixed; inset: 0;
  font-family: 'Sora', 'DM Sans', sans-serif;
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  background: var(--login-bg);
  color: var(--text-primary);
  overflow: hidden;
  z-index: 1000;
}

body.light-theme .view-login-wrapper {
  --login-bg:   var(--bg-surface);
  --login-line: rgba(15, 23, 42, 0.14);
}

/* ---------- Painel visual (esquerda) ---------- */

.login-hero {
  position: relative;
  overflow: hidden;
  background: #000;
  isolation: isolate;
}

.login-hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}

.login-hero-logo {
  position: absolute; top: 2.25rem; left: 2.5rem;
  height: 26px; width: auto;
  color: #fff;
}

/* ---------- Painel do formulário (direita) ---------- */

.login-panel {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}

.login-theme-toggle {
  position: absolute; top: 1rem; right: 1rem;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 100px;
  backdrop-filter: blur(14px) saturate(160%);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.38s cubic-bezier(0.22, 1.4, 0.36, 1), background 0.35s, border-color 0.35s;
}
.login-theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(79, 125, 255, 0.1);
  border-color: rgba(127, 176, 255, 0.4);
}
body.light-theme .login-theme-toggle {
  background: rgba(10, 14, 30, 0.04);
  border-color: rgba(10, 14, 30, 0.12);
}

.login-card {
  width: 100%; max-width: 380px;
  animation: loginFadeUp 0.45s ease both;
}

@keyframes loginFadeUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.login-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--login-accent);
  margin-bottom: 0.9rem;
}
.login-eyebrow::before {
  content: '';
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}

.login-title {
  font-size: 1.75rem; font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 2.25rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.75rem; }

.login-form .form-group label {
  display: block;
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-primary);
  text-transform: none; letter-spacing: 0;
  margin-bottom: 0.35rem;
}

.input-wrapper {
  position: relative;
  display: flex; align-items: center;
}

.input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--login-line);
  border-radius: 0;
  color: var(--text-primary);
  padding: 0.85rem 2.25rem 0.85rem 0.1rem;
  font-family: inherit; font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition);
}

.input-wrapper input:focus { border-bottom-color: var(--login-accent); }
.input-wrapper input::placeholder { color: var(--text-muted); }

/* Evita o fundo amarelo/branco do autofill do navegador */
.input-wrapper input:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary);
  transition: background-color 9999s ease-out;
}

.toggle-password {
  position: absolute; right: 0;
  background: none; border: none; padding: 0.35rem;
  color: var(--text-secondary); cursor: pointer; font-size: 0.9rem;
  transition: color var(--transition);
}
.toggle-password:hover { color: var(--text-primary); }

.login-error {
  background: rgba(239,68,68,0.12);
  border-left: 2px solid #ef4444;
  color: #fca5a5;
  padding: 0.6rem 0.875rem;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: -0.5rem;
}
body.light-theme .login-error { color: #b91c1c; }

/* Botão pílula de vidro (mesmo estilo do rickk.com.br) */
.btn-login {
  --btn-ease: cubic-bezier(0.22, 1.4, 0.36, 1);
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 10px 26px -10px rgba(0, 0, 0, 0.55);
  font-family: inherit; font-size: 0.9rem; font-weight: 500;
  cursor: pointer;
  transition: transform 0.38s var(--btn-ease), box-shadow 0.35s, background 0.35s, border-color 0.35s;
}
.btn-login::before {
  content: '';
  position: absolute; inset: -50% -65%;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 40%, rgba(127,176,255,0.08) 46%, rgba(255,255,255,0.24) 50%, rgba(127,176,255,0.08) 54%, transparent 60%);
  transform: translateX(-65%);
}
.btn-login i { font-size: 0.8rem; transition: transform 0.38s var(--btn-ease); }

@media (hover: hover) and (pointer: fine) {
  .btn-login:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(160, 190, 255, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 34px -10px rgba(70, 110, 255, 0.45);
  }
  .btn-login:hover::before { animation: loginBtnShine 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .btn-login:hover i { transform: translateX(4px); }
}
.btn-login:focus-visible {
  outline: none;
  border-color: #4f7dff;
  box-shadow: 0 0 0 4px rgba(79, 125, 255, 0.16);
}
.btn-login:active {
  transform: translateY(1px) scale(0.97);
  transition-duration: 0.1s;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}
.btn-login.loading { opacity: 0.7; pointer-events: none; }

@keyframes loginBtnShine {
  from { transform: translateX(-65%); }
  to   { transform: translateX(65%); }
}

/* No tema claro o vidro branco sumiria: usa vidro escuro */
body.light-theme .btn-login {
  background: rgba(10, 14, 30, 0.88);
  border-color: rgba(10, 14, 30, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 26px -10px rgba(10, 14, 30, 0.45);
}
@media (hover: hover) and (pointer: fine) {
  body.light-theme .btn-login:hover {
    background: rgba(10, 14, 30, 0.95);
    border-color: rgba(79, 125, 255, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 34px -10px rgba(70, 110, 255, 0.5);
  }
}


/* ---------- Responsivo ---------- */

@media (max-width: 860px) {
  .view-login-wrapper { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; }
  .login-hero-logo { top: 1.25rem; left: 1.25rem; }
  .login-panel { align-items: flex-start; padding: 2.5rem 1rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .login-card { animation: none; }
}
