
:root {
  --text-light: #ffffff;
  --text-muted: #c2cbd6;
  --input-bg: rgba(255, 255, 255, 0.08);
  --input-border: rgba(255, 255, 255, 0.18);
  --card-bg: rgba(18, 25, 40, 0.72);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: url('../img/fondo.jpeg') center/cover no-repeat fixed;
  position: relative;
}

/* Capa oscura para mejorar la legibilidad */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 30, 0.55);
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  color: var(--text-light);
  text-align: center;
}

.logo-header {
  margin-bottom: 24px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  padding: 3px;
  margin-bottom: 12px;
  object-fit: contain;
}

.login-card h1 {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 28px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}

.field label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.field input {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
  background: var(--input-bg);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
  opacity: 1;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.4);
}

.field input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.pass-wrap {
  position: relative;
}

.pass-wrap input {
  padding-right: 75px;
}

.toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.toggle-pass:hover {
  color: #ffffff;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.btn-primary {
  background: #ffffff;
  color: #0f172a;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.alert {
  display: none;
  font-size: 12.5px;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 20px;
  text-align: left;
}

.alert.show {
  display: block;
}

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

.alert.ok {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.foot {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 26px;
  line-height: 1.6;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.loading .spinner {
  display: block;
}

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

/* Tipografía Montserrat y logo UARM */
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}

html, body, input, select, textarea, button {
  font-family: 'Montserrat', Arial, sans-serif;
}

.logo-uarm {
  display: block;
  width: 100%;
  max-width: 310px;
  margin: 0 auto 14px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
}

.logo-header h1 {
  font-size: 22px;
}

/* ENLACES EN VERDE INSTITUCIONAL */
.login-card a,
.login-card a:link,
.login-card a:visited,
.login-card a:active,
.login-card a:hover {
  color: #00A556 !important;
  text-decoration: none !important;
  font-weight: 600;
  transition: color 0.2s ease;
}

.login-card a:hover {
  color: #156455 !important;
  text-decoration: underline !important;
}

/* AVISO DE RECUPERACIÓN SOBRE LA TARJETA */
.aviso-recuperacion {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 16px;
  padding: 15px;
  background: #E3F3E9;
  color: #156455;
  border: 1px solid #B9DFC9;
  border-radius: 10px;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.6;
}

.aviso-recuperacion strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}

.aviso-recuperacion p {
  margin: 0;
}

/* ============================================================
   AUTOCOMPLETADO DE CREDENCIALES
============================================================ */

/* Chrome, Edge, Safari y navegadores basados en WebKit */
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus,
.login-card input:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(18, 25, 40, 0.95) inset !important;
  box-shadow: 0 0 0 1000px rgba(18, 25, 40, 0.95) inset !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

/* Firefox */
.login-card input:autofill {
  color: #ffffff !important;
  background-color: rgba(18, 25, 40, 0.95) !important;
}

/* Mantener el botón VER visible */
.login-card .toggle-pass {
  color: #ffffff !important;
  background: transparent !important;
  z-index: 2;
}
