/* ============================================================================
   Login — Tin System 2.0  ·  rediseño visual (fresco y profesional)
   Usado por login.html e index.html (raíz).
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #4f46e5;
  --accent-2: #2563eb;
  --accent-dark: #4338ca;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
}

html, body { min-height: 100vh; }

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem 5rem;
  position: relative;
  background:
    radial-gradient(1100px 560px at 12% -10%, rgba(79,70,229,.20), transparent 60%),
    radial-gradient(950px 520px at 105% 112%, rgba(37,99,235,.16), transparent 55%),
    linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #e0e7ff 100%);
}

/* Logo arriba del card */
.logo { user-select: none; animation: fadeDown .5s ease both; }
.logo img {
  display: block;
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(30,41,59,.14));
}

/* Tarjeta del formulario */
.login-card {
  background: #fff;
  border: 1px solid rgba(79,70,229,.10);
  border-radius: 20px;
  box-shadow: 0 24px 50px -14px rgba(30,41,59,.24), 0 4px 12px rgba(30,41,59,.06);
  padding: 2.4rem 2.4rem 2.1rem;
  width: 400px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  animation: fadeUp .5s ease .05s both;
}

.login-card h2 {
  color: var(--ink);
  text-align: center;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -.01em;
}
.login-card .subtitle {
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
  margin-top: .35rem;
  margin-bottom: 1.7rem;
}

#loginForm { display: flex; flex-direction: column; }
#loginForm br { display: none; }

label {
  display: block;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: .45rem;
  color: var(--muted);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: .8rem .9rem;
  font-size: 1rem;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  margin-bottom: 1.1rem;
}
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79,70,229,.15);
}

button {
  margin-top: .4rem;
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .85rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 12px 22px -8px rgba(79,70,229,.55);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
button:hover, button:focus {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 28px -8px rgba(79,70,229,.6);
}
button:active { transform: translateY(0); }

/* Footer discreto, integrado al fondo claro */
footer {
  position: fixed;
  bottom: 0; left: 0; width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: .9rem 1rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  user-select: none;
}
footer a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
footer a:hover, footer a:focus { color: var(--accent-dark); text-decoration: underline; }

/* Mensajes (se muestran con jQuery .fadeIn) */
#message-box {
  margin-top: 1rem;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .92rem;
  color: #fff;
  text-align: center;
  display: none;
}
#message-box.success { background: #16a34a; }
#message-box.error   { background: #ef4444; }

@keyframes fadeUp   { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform:none; } }
@keyframes fadeDown { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform:none; } }

@media (max-width: 600px) {
  .login-card { width: 100%; padding: 2rem 1.4rem; }
  .logo img { max-width: 170px; }
  footer { font-size: .74rem; gap: 1rem; }
}
