/* Modern login page inspired by reference design */

body.login-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Raleway", "Segoe UI", sans-serif;
  color: #1b1b1b;
  overflow: hidden;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/static/images/bg-login.jpg");
  background-size: cover;
  background-position: center;
  filter: blur(14px);
  transform: scale(1.05);
  z-index: -2;
}

.login-page::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(27, 27, 27, 0.35),
    rgba(27, 27, 27, 0.5)
  );
  z-index: -1;
}

.login-content {
  width: 100%;
  max-width: 980px;
}

.login-card {
  display: flex;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  min-height: 520px;
}

.login-image-panel {
  flex: 0 0 46%;
  background-image: url("/static/images/bg-login.jpg");
  background-size: cover;
  background-position: center;
  position: relative;
}

.login-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    200deg,
    rgba(8, 47, 73, 0.2) 0%,
    rgba(8, 47, 73, 0.65) 65%
  );
  display: flex;
  align-items: flex-end;
  padding: 40px;
}

.login-image-text {
  color: #f8fafc;
  max-width: 260px;
}

.login-image-text span {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.9);
  margin-bottom: 12px;
}

.login-image-text h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  font-weight: 600;
  text-shadow: 0 4px 12px rgba(15, 23, 42, 0.4);
}

.login-form-panel {
  flex: 1;
  padding: 46px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  position: relative;
}

/* Header row: brand (left) + manual (right) — no overlap */
.login-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: transparent;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 16px;
  box-shadow: 0 12px 32px rgba(255, 152, 0, 0.3);
  overflow: hidden;
}

.login-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.brand-text h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1b1b1b;
}

.brand-text p {
  margin: 4px 0 0;
  color: #1b1b1b;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group-modern {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group-modern label {
  font-size: 13px;
  font-weight: 600;
  color: #1b1b1b;
  letter-spacing: 0.3px;
}

.input-modern {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(27, 27, 27, 0.2);
  background: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  transition: all 0.2s ease;
  color: #1b1b1b;
}

.input-modern::placeholder {
  color: rgba(27, 27, 27, 0.5);
}

.input-modern:focus {
  outline: none;
  border-color: rgba(255, 152, 0, 0.85);
  box-shadow: 0 8px 20px rgba(255, 152, 0, 0.18);
  background: rgba(255, 255, 255, 1);
}

.input-modern:focus::placeholder {
  color: rgba(27, 27, 27, 0.4);
}

.btn-login {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #ff9800, #ff9800);
  color: #1b1b1b;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(255, 152, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(255, 152, 0, 0.35);
  background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 14px 26px rgba(255, 152, 0, 0.25);
}

.login-help-text,
.login-recover-text {
  font-size: 12.5px;
  color: #1b1b1b;
  margin-top: 18px;
}

/* Manual de trazabilidad: single button, right-aligned in header */
.login-manual-trigger {
  flex-shrink: 0;
}

.login-manual-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid rgba(27, 27, 27, 0.2);
  border-radius: 12px;
  color: #1b1b1b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-manual-btn .fa {
  font-size: 16px;
  color: #ff9800;
}

.login-manual-btn:hover {
  background: rgba(255, 152, 0, 0.08);
  border-color: rgba(255, 152, 0, 0.4);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
}

.login-manual-btn:active {
  transform: translateY(0);
}

/* Help prompt: neutral bar with link-style trigger (distinct from CARDA) */
.login-help-prompt {
  margin-top: 22px;
  padding: 14px 18px;
  background: #f2f2f2;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.login-help-prompt-text {
  font-size: 14px;
  color: #333;
  margin: 0;
  line-height: 1.4;
}

.login-help-icon-inline {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #999;
  margin: 0;
  padding: 0;
  background: #fff;
  color: #333;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.login-help-icon-inline:hover {
  background: #e8e8e8;
  border-color: #666;
}

/* Help overlay */
.login-help-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.98);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-help-overlay:not(.is-open) .login-help-overlay-box {
  opacity: 0;
  transform: translateY(12px);
}

.login-help-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.login-help-overlay.is-open .login-help-overlay-box {
  opacity: 1;
  transform: translateY(0);
}

.login-help-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: none;
}

.login-help-overlay-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #ff9800;
  border-radius: 8px;
  padding: 24px 22px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.login-help-overlay-close {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #333;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.login-help-overlay-close:hover {
  background: #e8e8e8;
  border-color: #999;
}

.login-help-overlay-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #1b1b1b;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.login-help-overlay-text {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(27, 27, 27, 0.95);
}

.login-help-overlay-contact {
  margin-top: 4px;
}

.login-help-overlay-cta {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1b1b1b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-help-overlay-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-help-overlay-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: #1b1b1b;
}

.login-help-overlay-item .fa {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  margin-top: 2px;
  color: rgba(27, 27, 27, 0.9);
}

.login-help-overlay-item a {
  color: #000;
  text-decoration: underline;
}

.login-help-overlay-item a:hover {
  color: #333;
}

/* Manual overlay (DOCX download) */
.login-manual-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.98);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-manual-overlay:not(.is-open) .login-manual-overlay-box {
  opacity: 0;
  transform: translateY(12px);
}

.login-manual-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.login-manual-overlay.is-open .login-manual-overlay-box {
  opacity: 1;
  transform: translateY(0);
}

.login-manual-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: none;
}

.login-manual-overlay-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #ff9800;
  border-radius: 8px;
  padding: 24px 22px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.login-manual-overlay-close {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #333;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.login-manual-overlay-close:hover {
  background: #e8e8e8;
  border-color: #999;
}

.login-manual-overlay-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #1b1b1b;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.login-manual-overlay-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #444;
}

.login-manual-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #fff;
  color: #1b1b1b;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.login-manual-download-btn:hover {
  background: #f5f5f5;
  border-color: #999;
}

.login-manual-download-btn .fa {
  font-size: 16px;
}

@media (max-width: 1024px) {
  .login-card {
    flex-direction: column;
    min-height: auto;
  }

  .login-image-panel {
    height: 260px;
    flex: none;
  }

  .login-form-panel {
    padding: 36px 32px 40px;
  }

  .login-form-header {
    gap: 16px;
    margin-bottom: 24px;
  }
}

@media (max-width: 560px) {
  .login-form-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-manual-trigger {
    width: 100%;
  }

  .login-manual-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .login-page {
    padding: 24px 12px;
  }

  .login-content {
    max-width: 100%;
  }

  .login-card {
    border-radius: 18px;
  }

  .login-form-panel {
    padding: 32px 24px 36px;
  }

  .login-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .login-image-panel {
    height: 220px;
  }
}
