:root {
  --bg-page: #f3f4f6;
  --bg-blue: rgb(219 234 254);
  --blue: #1d4ed8;
  --text: #1d4ed8;
  --gray: #666;
  --btn-yellow: #fbbf24;
  --btn-hover: #f59e0b;
  --panel-gray: #232323;
  --shadow: 0 10px 28px rgba(17, 24, 39, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  font-family: "Roboto", Arial, sans-serif;
  color: var(--gray);
  height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("./images/logo-v.png");
  background-repeat: no-repeat;
  background-position: center 44%;
  background-size: min(720px, 92vw);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  gap: 0;
}

.container {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1 1 auto;
  justify-content: center;
  padding: 22px 20px 18px 20px;
}

.wrapper {
  display: flex;
  background: white;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 640px;
  width: 100%;
  min-height: 397px;
}

.form-section {
  flex: 1;
  padding: 34px 34px 36px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-section {
  flex: 0 0 42%;
  background: var(--panel-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 22px;
}

.logo-section img {
  max-width: 90%;
  height: auto;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  text-align: center;
}

.page-subtitle {
  font-size: 12px;
  line-height: 1.3;
  margin: 6px 0 0 0;
  text-align: center;
  max-width: 560px;
  color: #6b7280;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  position: relative;
}

.form-group input {
  width: 100%;
  padding: 10px 44px 10px 40px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
  font-family: "Roboto", Arial, sans-serif;
  color: var(--gray);
  transition: border-color 0.3s;
}

.form-group input::placeholder {
  color: #ccc;
}

.form-group input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.form-group .icon-left {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #9ca3af;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.form-group .icon-left svg {
  width: 16px;
  height: 16px;
  display: block;
}

.form-group.password .toggle-icon {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-login {
  width: 100%;
  padding: 12px 14px;
  background: var(--btn-yellow);
  color: white;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.3s;
}

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

.forgot-password {
  text-align: center;
  margin-top: 12px;
}

.forgot-password a {
  color: #ef4444;
  text-decoration: none;
  font-size: 12px;
}

.forgot-password a:hover {
  text-decoration: underline;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  background: var(--bg-blue);
  min-height: 64px;
  padding: 9px 12px 8px 12px;
  margin: 0;
  border-radius: 4px;
}

.alert-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
  margin-top: 2px;
}

.alert-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  line-height: 1.08;
  font-size: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.alert-title {
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  margin-bottom: 3px;
}

.alert-text {
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.alert-text a {
  color: var(--blue);
  text-decoration: none;
}

.alert-text a:hover {
  text-decoration: underline;
}

.alert-close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 1;
  cursor: default;
  pointer-events: none;
  margin-top: 2px;
}

.alert-close img {
  width: 24px;
  height: 24px;
  display: block;
}

.page-footer {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.35;
  color: #6b7280;
  text-align: center;
  max-width: 720px;
}

.page-footer a {
  color: #6b7280;
  text-decoration: underline;
}

.error-card {
  width: 100%;
  max-width: 640px;
  background: white;
  box-shadow: var(--shadow);
  padding: 28px 30px;
}

.error-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.error-text {
  margin: 8px 0 16px 0;
  font-size: 13px;
  color: #6b7280;
}

.overlay,
.OverlayDatosEspera {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.overlay[hidden],
.OverlayDatosEspera[hidden] {
  display: none;
}

.overlay-panel {
  width: 100%;
  max-width: 560px;
  background: white;
  box-shadow: var(--shadow);
  padding: 26px 28px;
}

.overlay-panel--small {
  max-width: 420px;
  text-align: center;
}

.overlay-form {
  margin-top: 14px;
}

.overlay-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-secondary {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  color: var(--gray);
  border: 1px solid #d1d5db;
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: #9ca3af;
}

.overlay-text {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #6b7280;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(29, 78, 216, 0.2);
  border-top-color: var(--blue);
  border-radius: 999px;
  margin: 0 auto 12px auto;
  animation: spin 0.9s linear infinite;
}

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

@media (max-width: 768px) {
  .wrapper {
    flex-direction: column;
  }

  .form-section,
  .logo-section {
    padding: 22px 22px;
  }
}
