/* ============================================
   Taskium Login - Glassmorphism Design
   Modo Dark/Light con variables CSS
   ============================================ */

:root {
  --brand: #6366f1;
  --brand-mid: #8b5cf6;
  --accent: #a78bfa;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bd: rgba(255, 255, 255, 0.11);
  --surface: rgba(12, 22, 40, 0.78);
  --bg-main: radial-gradient(circle at 15% 20%, #1e1b4b 0%, #0f172a 35%, #020617 100%);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ============================================
   TEMA CLARO
   ============================================ */
html[data-theme='light'] body {
  --brand: #4f46e5;
  --brand-mid: #7c3aed;
  --accent: #6366f1;
  --text: #1e293b;
  --text-muted: #64748b;
  --glass-bg: rgba(241, 245, 255, 0.84);
  --glass-bd: rgba(99, 102, 241, 0.18);
  --surface: rgba(248, 250, 252, 0.9);
  --bg-main: radial-gradient(circle at 16% 12%, #ddd6fe 0%, #e0e7ff 46%, #f1f5f9 100%);
}

/* ============================================
   BOTÓN FAB TEMA TOGGLE
   ============================================ */
.theme-fab {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.3);
  background: rgba(15, 23, 42, 0.74);
  color: #e0e7ff;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-fab:hover {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(139, 92, 246, 0.2);
  transform: scale(1.05);
}

html[data-theme='light'] .theme-fab {
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(237, 233, 254, 0.9);
}

html[data-theme='light'] .theme-fab:hover {
  color: #4338ca;
  border-color: rgba(79, 70, 229, 0.55);
  background: rgba(99, 102, 241, 0.2);
  transform: scale(1.05);
}

/* ============================================
   PÁGINA DE LOGIN
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  position: relative;
  z-index: 2;
}

.login-card {
  width: min(100%, 480px);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--glass-bd);
  border-radius: 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: reveal 0.8s ease;
}

html[data-theme='light'] .login-card {
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.16);
}

/* ============================================
   BLOQUE DE MARCA
   ============================================ */
.brand-block {
  text-align: center;
  padding: 36px 28px 20px;
}

.brand-logo {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.brand-block h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: 0.3px;
  font-weight: 700;
}

.brand-block p {
  margin: 9px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ============================================
   FORMULARIO
   ============================================ */
.login-form {
  padding: 12px 28px 24px;
}

.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #cbd5e1;
}

html[data-theme='light'] .field-group label {
  color: #475569;
}

.field-group input,
.field-group select {
  width: 100%;
  border: 1px solid rgba(203, 213, 225, 0.24);
  background: rgba(15, 23, 42, 0.52);
  color: var(--text);
  border-radius: 12px;
  height: 50px;
  padding: 0 16px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cbd5e1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 40px;
  cursor: pointer;
}

html[data-theme='light'] .field-group input,
html[data-theme='light'] .field-group select {
  border-color: rgba(99, 102, 241, 0.2);
  background: rgba(248, 250, 252, 0.92);
  color: #1e293b;
}

html[data-theme='light'] .field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.field-group input::placeholder {
  color: rgba(203, 213, 225, 0.6);
}

html[data-theme='light'] .field-group input::placeholder {
  color: #94a3b8;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
  transform: translateY(-1px);
  outline: none;
}

.field-group select:focus {
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

/* ============================================
   MENSAJES DE ERROR/ÉXITO
   ============================================ */
.alert {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid;
  backdrop-filter: blur(8px);
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

html[data-theme='light'] .alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #059669;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

html[data-theme='light'] .alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

.alert ul {
  margin: 0;
  padding-left: 20px;
}

.alert li {
  margin: 4px 0;
}

/* ============================================
   BOTÓN SUBMIT
   ============================================ */
.submit-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  height: 50px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand));
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  margin-top: 8px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(99, 102, 241, 0.5);
  filter: brightness(1.08);
}

.submit-btn:active {
  transform: translateY(0);
}

html[data-theme='light'] .submit-btn {
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.3);
}

html[data-theme='light'] .submit-btn:hover {
  box-shadow: 0 18px 32px rgba(79, 70, 229, 0.4);
}

/* ============================================
   FOOTER
   ============================================ */
.card-footer {
  border-top: 1px solid rgba(203, 213, 225, 0.16);
  padding: 18px 28px 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.34);
}

html[data-theme='light'] .card-footer {
  border-top-color: rgba(99, 102, 241, 0.16);
  background: rgba(237, 233, 254, 0.58);
}

.card-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.test-users {
  margin-top: 16px;
  text-align: left;
}

.test-users-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text);
}

.test-user-item {
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

html[data-theme='light'] .test-user-item {
  background: rgba(79, 70, 229, 0.06);
  border-color: rgba(79, 70, 229, 0.15);
}

.test-user-item strong {
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}

.test-user-item code {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================
   BLOBS ANIMADOS
   ============================================ */
.blob {
  position: fixed;
  z-index: 1;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  animation: drift 22s ease-in-out infinite;
  pointer-events: none;
}

html[data-theme='light'] .blob {
  opacity: 0.18;
  filter: blur(80px);
}

.blob-1 {
  width: 340px;
  height: 340px;
  top: -110px;
  left: -90px;
  background: rgba(139, 92, 246, 0.75);
}

.blob-2 {
  width: 380px;
  height: 380px;
  top: 48%;
  right: -120px;
  background: rgba(99, 102, 241, 0.62);
  animation-delay: -7s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  bottom: -100px;
  left: 32%;
  background: rgba(167, 139, 250, 0.58);
  animation-delay: -12s;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes drift {
  0%,
  100% {
    transform: translateY(0) translateX(0) scale(1);
  }
  50% {
    transform: translateY(-26px) translateX(10px) scale(1.06);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 520px) {
  .theme-fab {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .login-card {
    border-radius: 18px;
  }

  .brand-block,
  .login-form,
  .card-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .brand-logo {
    font-size: 2.8rem;
  }

  .field-group input,
  .field-group select {
    height: 46px;
    font-size: 0.92rem;
  }

  .submit-btn {
    height: 46px;
    font-size: 0.95rem;
  }
}
