/* ==========================================================================
   Tecno-Cursos — Login Page (Modern Redesign 2026)
   Premium Dark Theme · Glassmorphism · Animated Gradient
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);

  --gradient-start: #6366f1;
  --gradient-mid: #8b5cf6;
  --gradient-end: #a855f7;

  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);
  --success-text: #6ee7b7;

  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);
  --danger-text: #fca5a5;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.55);
  --shadow-glow: 0 0 60px rgba(99,102,241,.12);

  --transition-fast: 180ms cubic-bezier(.4,0,.2,1);
  --transition-normal: 300ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 500ms cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ---------- Animated Background ---------- */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Gradient mesh blobs */
.login-bg::before,
.login-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
  animation: floatBlob 20s ease-in-out infinite;
}

.login-bg::before {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, var(--gradient-start), transparent 70%);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.login-bg::after {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--gradient-end), transparent 70%);
  bottom: -20%;
  right: -8%;
  animation-delay: -10s;
}

.blob-extra {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gradient-mid), transparent 70%);
  filter: blur(100px);
  opacity: .2;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  animation: floatBlob 25s ease-in-out infinite reverse;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(40px, -30px) scale(1.08); }
  50%      { transform: translate(-20px, 40px) scale(.95); }
  75%      { transform: translate(30px, 20px) scale(1.04); }
}

/* Grid pattern overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
}

/* Noise texture */
.noise-overlay {
  position: absolute;
  inset: 0;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  z-index: 2;
}

/* ---------- Layout ---------- */
.login-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------- Glass Card ---------- */
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px 40px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  animation: cardEntrance .8s var(--transition-slow) both;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(99,102,241,.4),
    rgba(139,92,246,.3),
    transparent
  );
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(30px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Brand / Logo ---------- */
.brand-area {
  text-align: center;
  margin-bottom: 10px;
  animation: fadeSlideUp .6s .3s both;
}

.brand-area img {
  max-height: 70px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(99, 102, 241, .15));
  transition: var(--transition-normal);
}

.brand-area img:hover {
  filter: drop-shadow(0 4px 20px rgba(99, 102, 241, .25));
  transform: scale(1.03);
}

/* ---------- Header ---------- */
.login-header {
  text-align: center;
  margin-bottom: 36px;
  animation: fadeSlideUp .6s .4s both;
}

.login-header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-shadow: none;
  margin-bottom: 6px;
}

.login-header p {
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: .01em;
}

/* ---------- Form ---------- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeSlideUp .6s .5s both;
}

/* Input Groups */
.input-group {
  position: relative;
}

.input-group label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: .03em;
  text-transform: uppercase;
  transition: var(--transition-fast);
}

.input-group .input-wrapper {
  position: relative;
}

.input-group .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: var(--transition-fast);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-group .input-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-group input {
  width: 100%;
  height: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 400;
  padding: 0 48px 0 48px;
  outline: none;
  transition: var(--transition-fast);
  text-shadow: none;
}

.input-group input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.input-group input:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,.12);
}

.input-group input:focus {
  background: var(--surface-hover);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}

.input-group input:focus ~ .input-icon,
.input-group input:focus + .input-icon {
  color: var(--accent);
}

.input-group:focus-within label {
  color: var(--accent-hover);
}

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
  border-radius: 6px;
}

.toggle-password:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,.05);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Forgot Password ---------- */
.forgot-link-wrapper {
  text-align: right;
  margin-top: -8px;
}

.forgot-link {
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
}

.forgot-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: var(--transition-normal);
}

.forgot-link:hover {
  color: var(--accent-hover);
}

.forgot-link:hover::after {
  width: 100%;
}

/* ---------- Submit Button ---------- */
.btn-login {
  position: relative;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
  background-size: 200% 200%;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-normal);
  margin-top: 8px;
  text-shadow: none;
  animation: gradientShift 4s ease-in-out infinite;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent, rgba(255,255,255,.05));
  opacity: 0;
  transition: var(--transition-normal);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,.35), 0 2px 8px rgba(0,0,0,.3);
}

.btn-login:hover::before {
  opacity: 1;
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(99,102,241,.25);
}

/* Loading state */
.btn-login.loading {
  pointer-events: none;
  opacity: .8;
}

.btn-login.loading .btn-text {
  opacity: 0;
}

.btn-login.loading .btn-spinner {
  display: block;
}

.btn-text {
  position: relative;
  z-index: 1;
  transition: var(--transition-fast);
}

.btn-spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ---------- Alerts ---------- */
.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.5;
  animation: alertSlide .4s ease both;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: none;
}

.alert-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

@keyframes alertSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Divider ---------- */
.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider span {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
}

/* ---------- Footer ---------- */
.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  animation: fadeSlideUp .6s .7s both;
}

.login-footer p {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: .02em;
}

.login-footer .platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .03em;
}

.platform-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, .4); }
  50%      { opacity: .7; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

/* ---------- Animations ---------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Particles ---------- */
.particles {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(99, 102, 241, .4);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-duration: 18s; animation-delay: 0s; width: 3px; height: 3px; }
.particle:nth-child(2) { left: 25%; animation-duration: 22s; animation-delay: -4s; }
.particle:nth-child(3) { left: 40%; animation-duration: 16s; animation-delay: -8s; width: 2.5px; height: 2.5px; }
.particle:nth-child(4) { left: 55%; animation-duration: 20s; animation-delay: -2s; }
.particle:nth-child(5) { left: 70%; animation-duration: 24s; animation-delay: -6s; width: 3px; height: 3px; }
.particle:nth-child(6) { left: 85%; animation-duration: 17s; animation-delay: -10s; }
.particle:nth-child(7) { left: 15%; animation-duration: 21s; animation-delay: -14s; width: 2px; height: 2px; }
.particle:nth-child(8) { left: 60%; animation-duration: 19s; animation-delay: -12s; }

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .login-card {
    padding: 36px 24px 32px;
    border-radius: var(--radius-lg);
    margin: 0 8px;
  }

  .login-header h1 {
    font-size: 1.4rem;
  }

  .brand-area img {
    max-height: 56px;
  }

  .input-group input {
    height: 48px;
    font-size: .9rem;
  }

  .btn-login {
    height: 48px;
  }
}

@media (max-width: 360px) {
  .login-card {
    padding: 28px 18px 26px;
  }

  .login-header h1 {
    font-size: 1.25rem;
  }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(99, 102, 241, .3);
  color: #fff;
}

/* ---------- Scrollbar (if needed) ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.18);
}
