@charset "UTF-8";

/* ================================================================
   SIRMIN — Login Page Styles
   Design: Dark glassmorphism · Emerald accent · Inter font
   ================================================================ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg:            #0d0d0d;
  --card-bg:       rgba(18, 18, 18, 0.82);
  --card-border:   rgba(255, 255, 255, 0.08);
  --card-shadow:   0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.04);
  --accent:        #c8293a;
  --accent-glow:   rgba(200, 41, 58, 0.35);
  --accent-hover:  #a81f2e;
  --input-bg:      rgba(255, 255, 255, 0.04);
  --input-border:  rgba(255, 255, 255, 0.09);
  --input-focus:   rgba(200, 41, 58, 0.45);
  --text:          #f5f5f5;
  --muted:         #6b7280;
  --error-bg:      rgba(200, 41, 58, 0.12);
  --error-border:  rgba(200, 41, 58, 0.45);
  --error-text:    #f9a8a8;
  --radius:        14px;
  --radius-sm:     9px;
  --transition:    200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Background ─────────────────────────────────────────────────── */
body {
  background-image:
    linear-gradient(135deg, rgba(6, 6, 8, 0.72) 0%, rgba(6, 6, 8, 0.60) 100%),
    url('../img/fondo_01.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Viñeta oscura en bordes para centrar la atención en la card */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 80% at 50% 50%, transparent 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Orbs: esferas de color animadas ────────────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.orb-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(200,41,58,0.38) 0%, transparent 70%);
  top: -140px; left: -140px;
  animation: orbDriftA 20s ease-in-out infinite alternate;
}

.orb-2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(160,20,38,0.28) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation: orbDriftB 26s ease-in-out infinite alternate;
}

.orb-3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(200,41,58,0.16) 0%, transparent 70%);
  top: 45%; left: 55%;
  animation: orbDriftC 32s ease-in-out infinite alternate;
}

@keyframes orbDriftA {
  from { transform: translate(0,   0)   scale(1);    }
  to   { transform: translate(90px, 70px) scale(1.12); }
}
@keyframes orbDriftB {
  from { transform: translate(0,    0)    scale(1);    }
  to   { transform: translate(-70px,-90px) scale(1.09); }
}
@keyframes orbDriftC {
  from { transform: translate(0,   0)   scale(1);   }
  to   { transform: translate(-50px,60px) scale(0.92); }
}

/* Grain: textura sutil de ruido para mayor abstracción */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  opacity: 0.028;
  pointer-events: none;
  z-index: 0;
}

/* ── Wrapper ─────────────────────────────────────────────────────── */
.login-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── Card ────────────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 48px 44px 40px;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Brand ───────────────────────────────────────────────────────── */
.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto 14px;
  /* Asegura visibilidad sobre fondo oscuro */
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.brand-tagline {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.1px;
}

/* ── Divider ─────────────────────────────────────────────────────── */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-divider span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/* ── Alert ───────────────────────────────────────────────────────── */
.alert-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
  color: var(--error-text);
  font-size: 13.5px;
  animation: alertIn 0.2s ease both;
}

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-error svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #ef4444;
}

/* ── Input Group ─────────────────────────────────────────────────── */
.field-group {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
  transition: color var(--transition);
  flex-shrink: 0;
}

.field-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px 42px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.field-input::placeholder {
  color: #3d5170;
}

.field-input:focus {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.04);
  box-shadow: 0 0 0 3px var(--input-focus);
}

.field-input:focus + .field-icon,
.field-wrap:focus-within .field-icon {
  color: var(--accent);
}

/* Password toggle */
.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color var(--transition);
  line-height: 0;
}

.btn-toggle-pwd:hover { color: var(--text); }

.field-input.has-toggle { padding-right: 42px; }

/* ── Options row ─────────────────────────────────────────────────── */
.login-options {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 28px;
}

.link-forgot {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.link-forgot:hover { color: var(--accent); }

/* ── Submit Button ───────────────────────────────────────────────── */
.btn-login {
  position: relative;
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #e8303f 0%, var(--accent) 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.1px;
  overflow: hidden;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(200, 41, 58, 0.35);
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(200, 41, 58, 0.5);
}

.btn-login:hover::before { opacity: 1; }

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(200, 41, 58, 0.3);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-login svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}

.btn-login:hover svg { transform: translateX(3px); }

/* Loading state */
.btn-login .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-login.loading .btn-text,
.btn-login.loading svg.btn-arrow { display: none; }
.btn-login.loading .btn-spinner  { display: block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Footer ──────────────────────────────────────────────────────── */
.login-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12.5px;
  color: #2d3d55;
}

.login-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

.login-footer a:hover { color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card {
    padding: 36px 28px 32px;
    border-radius: 18px;
  }
}

/* ── Créditos y licencias ────────────────────────────────────────── */
.link-licenses {
  display: inline-block;
  margin-top: 7px;
  font-size: 11px;
  color: #4b5563;
  text-decoration: none;
  transition: color var(--transition);
}
.link-licenses:hover { color: #9ca3af; }

/* ── Modal Licencias (Bootstrap 5) ───────────────────────────────── */
/* Doble clase para superar especificidad de Bootstrap */
.modal-content.lic-modal-content {
  border: none;
  border-radius: 18px;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
}

/* Header: franja roja degradada igual que las cards de analysis */
.modal-header.lic-modal-header {
  background: linear-gradient(135deg, #fca5a5 0%, #dc2626 100%);
  border-bottom: none;
  padding: 22px 26px;
  position: relative;
}
.modal-header.lic-modal-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 60%);
  pointer-events: none;
}
.lic-modal-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.lic-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
  line-height: 1.2;
  margin-bottom: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.lic-modal-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,.75);
}

/* Body */
.modal-body.lic-modal-body {
  padding: 24px 26px 16px;
  background: #f1f3f7;
}

/* Tabla */
.lic-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e4e7ef;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.lic-table thead tr {
  background: #fff;
  border-bottom: 1px solid #e4e7ef;
}
.lic-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 2px solid #e4e7ef;
}
.lic-table tbody tr {
  border-bottom: 1px solid #f1f3f7;
  transition: background 120ms;
}
.lic-table tbody tr:last-child td { border-bottom: none; }
.lic-table tbody tr:hover { background: #fef2f2; }
.lic-table td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f3f7;
}
.lic-table-name   { font-weight: 600; color: #0f172a; white-space: nowrap; }
.lic-table-author { color: #64748b;   font-size: 12.5px; }
.lic-ver {
  font-size: 12px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.lic-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.lic-tag--mit { background: #dcfce7; color: #15803d; }
.lic-tag--com { background: #fee2e2; color: #9f1239; }

.lic-modal-note {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.65;
  margin-top: 16px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 10px;
  border: 1px dashed #e4e7ef;
}

/* Footer */
.modal-footer.lic-modal-footer {
  background: #fff;
  border-top: 1px solid #e4e7ef;
  padding: 14px 26px;
}
.lic-modal-btn {
  background: linear-gradient(135deg, #fca5a5 0%, #dc2626 100%);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 9px 28px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(220,38,38,.35);
  transition: opacity 150ms, transform 150ms;
}
.lic-modal-btn:hover  { opacity: .88; color: #fff; transform: translateY(-1px); }
.lic-modal-btn:active { transform: translateY(0); opacity: 1; }
