:root {
  /* ===========================
     TEMA CLARO
  =========================== */

  --ink: #111827;
  --ink-soft: #64748b;

  --paper: #f8fafc;
  --paper-card: #ffffff;
  --line: #dbe4ee;

  --blue-1: #1e44f0;
  --blue-2: #2563eb;

  --black: #020617;
  --cyan: #38bdf8;

  --focus: 0 0 0 4px rgba(37, 99, 235, 0.18);

  --input-bg: #ffffff;
  --input-color: #111827;
  --placeholder: #94a3b8;

  --body-bg:
    radial-gradient(
      ellipse at top left,
      rgba(96, 165, 250, 0.45),
      transparent 45%
    ),
    radial-gradient(
      ellipse at top right,
      rgba(59, 130, 246, 0.35),
      transparent 40%
    ),
    radial-gradient(
      ellipse at bottom left,
      rgba(30, 64, 175, 0.45),
      transparent 45%
    ),
    radial-gradient(
      ellipse at center,
      rgba(37, 99, 235, 0.25),
      transparent 60%
    ),
    linear-gradient(135deg, #ffffff, #f8fafc, #dbeafe);

  --brand-gradient: linear-gradient(135deg, #ef4444, #2563eb);
}

/* ===========================
   MODO OSCURO
=========================== */

[data-theme="oscuro"] {
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;

  --paper: #111827;
  --paper-card: #1e293b;

  --line: #334155;

  --blue-1: #1e44f0;
  --blue-2: #3b82f6;

  --black: #020617;

  --input-bg: #0f172a;
  --input-color: #f8fafc;

  --placeholder: #94a3b8;

  --body-bg:
    radial-gradient(
      circle at top left,
      rgba(239, 68, 68, 0.18),
      transparent 45%
    ),
    radial-gradient(
      circle at top right,
      rgba(59, 130, 246, 0.22),
      transparent 45%
    ),
    linear-gradient(135deg, #020617, #0f172a, #1e293b);

  --brand-gradient: linear-gradient(135deg, #ef4444, #3b82f6);
}

/* ===========================
   BASE
=========================== */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;

  font-family: "Inter", "Segoe UI", Arial, sans-serif;

  display: flex;

  justify-content: center;

  align-items: center;

  padding: 25px;

  color: var(--ink);

  overflow: hidden;

  background: var(--body-bg);

  transition: 0.35s ease;
}

/* ===========================
   CONTENEDOR
=========================== */

.center-screen {
  width: 100%;

  display: flex;
  text-align: center;

  justify-content: center;
}

.auth-container {
  width: 100%;

  max-width: 420px;
}

/* ===========================
   MARCA
=========================== */

.brand {
  text-align: center;

  margin-bottom: 28px;

  animation: fade 0.6s ease;
}

.brand-logo,
.brand-icon {
  width: 82px;

  height: 82px;

  margin: auto;

  border-radius: 26px;

  display: flex;

  align-items: center;

  justify-content: center;

  background: var(--brand-gradient);

  color: white;

  box-shadow:
    0 25px 60px rgba(239, 68, 68, 0.25),
    0 25px 60px rgba(37, 99, 235, 0.25);
}

.brand-logo {
  background: white;

  padding: 8px;

  object-fit: contain;
}

.brand-icon i {
  font-size: 34px;
}

.brand-name {
  margin-top: 15px;

  color: var(--ink);

  font-size: 20px;

  font-weight: 900;

  letter-spacing: -0.04em;
}

/* ===========================
   TARJETA
=========================== */

.card {
  background: var(--paper-card);

  border-radius: 28px;

  padding: 38px;

  position: relative;

  overflow: hidden;

  border: 1px solid var(--line);

  box-shadow:
    0 35px 100px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04);

  animation: slide 0.7s ease;

  transition: 0.35s ease;
}

.card-glow {
  position: absolute;

  width: 260px;

  height: 260px;

  right: -120px;

  top: -120px;

  border-radius: 50%;

  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.25),
    transparent 70%
  );
}

/* ===========================
   HEADER
=========================== */

.card-header {
  position: relative;

  text-align: center;
}

.icon-circle {
  width: 58px;

  height: 58px;

  margin: 0 auto 18px;

  border-radius: 20px;

  display: flex;

  justify-content: center;

  align-items: center;

  background: rgba(37, 99, 235, 0.12);

  color: var(--blue-2);
}

.icon-circle i {
  font-size: 24px;
}

h1 {
  margin: 0;

  font-family: "Archivo Black", sans-serif;

  font-size: 28px;

  font-weight: 900;

  letter-spacing: -0.04em;

  text-transform: uppercase;

  color: var(--ink);
}

.subtitle {
  margin: 12px auto 0;

  max-width: 310px;

  color: var(--ink-soft);

  line-height: 1.6;

  font-size: 14px;
}

/* ===========================
   FORMULARIO
=========================== */

form {
  margin-top: 30px;

  display: flex;

  flex-direction: column;

  gap: 20px;
}

.field label {
  display: block;

  margin-bottom: 8px;

  font-size: 13px;

  font-weight: 700;

  color: var(--ink);
}

.field-icon-wrap {
  position: relative;
}

.field-icon-wrap i {
  position: absolute;

  left: 16px;

  top: 50%;

  transform: translateY(-50%);

  color: var(--ink-soft);
}

input {
  width: 100%;

  height: 54px;

  border-radius: 14px;

  border: 1.5px solid var(--line);

  padding: 0 18px 0 48px;

  background: var(--input-bg);

  color: var(--input-color);

  font-size: 15px;

  outline: none;

  transition: 0.25s;
}

input::placeholder {
  color: var(--placeholder);
}

input:hover {
  border-color: #93c5fd;
}

input:focus {
  border-color: var(--blue-2);

  box-shadow: var(--focus);
}

/* ===========================
   BOTONES
=========================== */

.btn {
  width: 100%;

  height: 54px;

  margin-top: 22px;

  border: none;

  border-radius: 14px;

  cursor: pointer;

  font-size: 15px;

  font-weight: 800;

  color: white;

  display: flex;

  justify-content: center;

  align-items: center;

  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2));

  box-shadow:
    0 15px 35px rgba(239, 68, 68, 0.25),
    0 15px 35px rgba(37, 99, 235, 0.25);

  transition: 0.25s;
}

.btn-primary:hover {
  transform: translateY(-3px);

  box-shadow:
    0 20px 45px rgba(239, 68, 68, 0.35),
    0 20px 45px rgba(37, 99, 235, 0.35);
}

/* ===========================
   ALERTAS
=========================== */

.alert {
  margin-top: 25px;

  padding: 16px;

  border-radius: 16px;

  display: flex;

  gap: 12px;

  align-items: flex-start;

  font-size: 14px;

  line-height: 1.5;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);

  color: #dc2626;
}

.alert-success {
  background: rgba(37, 99, 235, 0.12);

  color: #2563eb;
}

/* ===========================
   FOOTER
=========================== */

.footer-link {
  text-align: center;

  margin-top: 25px;
}

.footer-link a {
  color: var(--ink-soft);

  text-decoration: none;

  font-size: 14px;

  font-weight: 600;
}

.footer-link a:hover {
  color: var(--blue-2);
}

/* ===========================
   ANIMACIONES
=========================== */

@keyframes slide {
  from {
    opacity: 0;

    transform: translateY(25px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ===========================
   RESPONSIVE
=========================== */

@media (max-width: 480px) {
  body {
    padding: 15px;
  }

  .card {
    padding: 30px 22px;

    border-radius: 22px;
  }

  h1 {
    font-size: 23px;
  }

  .brand-logo,
  .brand-icon {
    width: 72px;

    height: 72px;

    border-radius: 22px;
  }

  .brand-name {
    font-size: 18px;
  }
}

/* ===========================
   TRANSICIONES DE TEMA
=========================== */

body,
.card,
input,
.icon-circle,
.brand-logo,
.brand-icon {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* ===========================
   BOTÓN CAMBIO DE TEMA
=========================== */

.theme-toggle {
  position: fixed;

  top: 20px;

  right: 20px;

  width: 46px;

  height: 46px;

  border-radius: 50%;

  border: 1px solid rgba(120, 120, 120, 0.25);

  background: var(--paper-card);

  color: var(--ink);

  display: flex;

  align-items: center;

  justify-content: center;

  cursor: pointer;

  font-size: 22px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);

  transition: 0.3s ease;

  z-index: 9999;
}

.theme-toggle:hover {
  transform: rotate(20deg) scale(1.08);
}

/* ICONOS DEL TEMA */

.icon {
  width: 21px;

  height: 21px;

  fill: none;

  stroke: currentColor;

  stroke-width: 1.8;

  stroke-linecap: round;

  stroke-linejoin: round;
}

.moon {
  color: #2563eb;
}

.sun {
  display: none;

  color: #f59e0b;
}

/* OSCURO = MOSTRAR SOL */

html[data-theme="oscuro"] .moon {
  display: none;
}

html[data-theme="oscuro"] .sun {
  display: block;
}

/* ===========================
   MEJORAS EXTRA
=========================== */

.card:hover {
  transform: translateY(-2px);
}

input,
.btn {
  will-change: transform;
}

.btn:active {
  transform: scale(0.98);
}
