/* ==================== LOGIN INSTITUCIONAL ==================== */

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

:root {
  --bg-page: #f3f4f6;
  --bg-card: #ffffff;
  --border-soft: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --blue-main: #1d4ed8;
  --blue-hover: #1e40af;
  --blue-focus: rgba(37, 99, 235, 0.16);
  --gray-input: #d1d5db;
  --danger: #b91c1c;
}

body {
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
  padding: 1.5rem;
}

.auth-header {
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.auth-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--blue-main);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

input[type="email"],
input[type="password"],
select {
  width: 100%;
  border: 1px solid var(--gray-input);
  border-radius: 0.5rem;
  background: #ffffff;
  color: var(--text-main);
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--blue-main);
  box-shadow: 0 0 0 3px var(--blue-focus);
}

button[type="submit"] {
  width: 100%;
  border: none;
  border-radius: 0.5rem;
  background: var(--blue-main);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.7rem 1rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: background-color 0.18s ease, transform 0.12s ease;
}

button[type="submit"]:hover {
  background: var(--blue-hover);
}

button[type="submit"]:active {
  transform: translateY(1px);
}

button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

button[type="submit"].is-loading {
  position: relative;
  opacity: 0.75;
}

button[type="submit"].is-loading::after {
  content: "";
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #ffffff;
  border-radius: 50%;
  vertical-align: -0.12rem;
  animation: login-spin 0.75s linear infinite;
}

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

.forgot-password-btn {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--blue-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: -0.35rem;
}

.forgot-password-btn:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

.login-status {
  min-height: 1.25rem;
  margin-top: 1rem;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.hidden,
.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 26rem;
  background: var(--bg-card);
  border-radius: 0.75rem;
  border: 1px solid var(--border-soft);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
  padding: 1.5rem;
}

.modal-card h2 {
  color: var(--blue-main);
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.primary-btn,
.secondary-btn {
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
}

.primary-btn {
  border: none;
  background: var(--blue-main);
  color: #ffffff;
}

.primary-btn:hover {
  background: var(--blue-hover);
}

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

.secondary-btn {
  border: 1px solid var(--gray-input);
  background: #ffffff;
  color: var(--text-main);
}

.secondary-btn:hover {
  border-color: var(--blue-main);
}

.reset-status {
  min-height: 1.25rem;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding: 1rem;
  }

  .auth-card {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }
}
