/* public/css/login.css
   Hereda la estética de styles.css — mismas variables, tipografía y tokens */

/* ── VARIABLES (espejo de styles.css) ───────────────────── */
:root {
  --bg:           #0d0d0f;
  --bg-2:         #131316;
  --bg-3:         #1a1a1f;
  --bg-4:         #202026;
  --bg-5:         #27272f;

  --border:       rgba(255,255,255,0.07);
  --border-2:     rgba(255,255,255,0.13);
  --border-3:     rgba(255,255,255,0.2);

  --text:         #f0efe8;
  --text-2:       #9b9a94;
  --text-3:       #5c5b57;

  --accent:       #7c6ef0;
  --accent-light: #a59af5;
  --accent-dim:   rgba(124,110,240,0.12);
  --accent-border:rgba(124,110,240,0.28);

  --danger:       #f87171;
  --danger-dim:   rgba(248,113,113,0.1);

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(0,0,0,0.6);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
}

/* ── BRAND ───────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'DM Serif Display', serif;
  font-size: 17px;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ── CARD ────────────────────────────────────────────────── */
.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
}

.login-title {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 26px;
}

/* ── CAMPOS ──────────────────────────────────────────────── */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--accent-border);
}

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

/* Input con botón de mostrar contraseña */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  padding-right: 40px;
}

.toggle-pass {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.12s;
}

.toggle-pass:hover {
  color: var(--text-2);
}

/* ── BOTÓN INGRESAR ──────────────────────────────────────── */
.btn-login {
  width: 100%;
  margin-top: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-login:hover  { opacity: 0.88; }
.btn-login:active { transform: scale(0.98); }
.btn-login:disabled { opacity: 0.4; cursor: not-allowed; }

/* Spinner dentro del botón */
.spinner-btn {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
  flex-shrink: 0;
}

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

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

/* ── MENSAJES ────────────────────────────────────────────── */
.error-msg {
  display: none;
  background: var(--danger-dim);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  padding: 10px 14px;
  margin-top: 14px;
  text-align: center;
}

.error-msg.visible { display: block; }

.intentos-msg {
  display: none;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 10px;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 16px; align-items: flex-start; padding-top: 48px; }
  .login-card { padding: 24px 20px; }
}