/* Estilos de login.php. Estaban en un bloque <style> de la página; en un
   archivo, la CSP puede prohibir los estilos en línea. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0a0f0d;
  --bg-card: rgba(14, 22, 17, 0.65);
  --emerald: #34d399;
  --emerald-dim: #059669;
  --emerald-glow: rgba(52, 211, 153, 0.12);
  /* Botón principal: verde SENA en tonos que dejan al texto blanco con
     contraste suficiente (WCAG AA: 4,6:1 y 6,6:1). El verde de la marca,
     #39A900, solo daba 3:1 con texto blanco. */
  --sena-boton: #2D8600;
  --sena-boton-oscuro: #246B00;
  --sena-boton-hover: #1C5400;
  --sena-brillo: rgba(57, 169, 0, 0.35);
  --text-primary: #f0fdf4;
  --text-secondary: #a7b5ae;
  --text-muted: #5a6b62;
  --border: rgba(52, 211, 153, 0.1);
  --border-hover: rgba(52, 211, 153, 0.25);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Canvas ── */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Ambient glow spots ── */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
}

body::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.08), transparent 70%);
  top: -10%;
  left: -5%;
  animation: floatA 20s ease-in-out infinite;
}

body::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.06), transparent 70%);
  bottom: -15%;
  right: -5%;
  animation: floatB 24s ease-in-out infinite;
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, 30px); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, -40px); }
}

/* ── Shell ── */
.shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Left Panel ── */
.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem;
  border-right: 1px solid var(--border);
  position: relative;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 3rem;
}

.brand-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--emerald-glow));
}

.brand-logo span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--emerald);
  text-transform: uppercase;
}

.brand h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.08;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  letter-spacing: -0.03em;
}

.brand h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--emerald), #6ee7b7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 440px;
}

.brand-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-features .feat {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.brand-features .feat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.brand-footer {
  position: absolute;
  bottom: 2.5rem;
  left: 5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Right Panel ── */
.form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 60px rgba(52, 211, 153, 0.04);
}

/* ── Card Banner ── */
.card-banner {
  background: linear-gradient(135deg, rgba(57, 169, 0, 0.15), rgba(10, 15, 13, 0.95));
  border-bottom: 2px solid #39A900;
  padding: 22px 24px;
  margin: -48px -40px 30px -40px;
  border-top-left-radius: 19px;
  border-top-right-radius: 19px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-banner img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(57, 169, 0, 0.4));
}

.banner-text h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  margin: 0;
  line-height: 1.2;
}

.banner-text p {
  font-size: 0.68rem;
  color: #39A900;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2px 0 0 0;
  line-height: 1.2;
}

.card-header {
  text-align: center;
  margin-bottom: 30px;
}

.card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.card-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Input Icons & Group ── */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-group i.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

.input-group input {
  padding-left: 46px !important;
  padding-right: 44px !important;
  height: 48px;
}

.input-group input:focus ~ i.input-icon {
  color: var(--emerald);
}

/* ── Toggle Password Button ── */
.toggle-password {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  z-index: 10;
}

.toggle-password:hover {
  color: var(--emerald);
}

/* ── Form ── */
.field {
  margin-bottom: 24px;
}

.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  padding: 13px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.field input::placeholder {
  color: var(--text-muted);
}

.field input:focus {
  outline: none;
  border-color: var(--emerald);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1), 0 0 20px rgba(52, 211, 153, 0.05);
}

.submit-btn {
  width: 100%;
  padding: 14px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--sena-boton) 0%, var(--sena-boton-oscuro) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  z-index: -1;
}

.submit-btn:hover {
  /* Se oscurece en lugar de aclararse: el texto blanco sigue legible. */
  background: linear-gradient(135deg, var(--sena-boton-oscuro) 0%, var(--sena-boton-hover) 100%);
  color: #fff;
  box-shadow: 0 8px 24px var(--sena-brillo);
  transform: translateY(-2px);
}

.submit-btn:hover::before {
  animation: sweepSheen 0.65s ease-in-out;
}

@keyframes sweepSheen {
  0% { left: -100%; }
  100% { left: 100%; }
}

.submit-btn:active {
  transform: translateY(0) scale(0.97);
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.alert-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.alert-success {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

/* ── Footer link ── */
.card-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.card-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.3s;
}

.card-footer a:hover {
  color: var(--emerald);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .brand { display: none; }
  .card { max-width: 420px; }
}

@media (max-width: 480px) {
  .card { padding: 36px 24px; border-radius: 16px; }
  .card-banner {
     margin: -36px -24px 24px -24px;
     border-top-left-radius: 15px;
     border-top-right-radius: 15px;
     padding: 18px 20px;
  }
}

.field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.04);
}
.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #1e293b;
  color: var(--text-muted);
  box-shadow: none;
  transform: none !important;
}
.submit-btn:disabled::before {
  display: none;
}
