/* ==========================================================================
   Section: login drawer — right-hand sidebar opened from "Banca Internet"
   Values extracted from live site (Drawer_container / DrawerFormLogin).
   ========================================================================== */

/* Overlay (sibling of the drawer, dims the page) */
.x-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease-out .3s, visibility .45s;
}
.x-drawer-overlay.is-open { opacity: 1; visibility: visible; }

/* Panel */
.x-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 400px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-gray); /* #F4F7F9 (live: rgb(245,247,249)) */
  border-radius: var(--r-card) 0 0 var(--r-card); /* 16px 0 0 16px */
  padding: 24px 32px;
  z-index: 1002;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .45s ease-out, visibility .45s;
  overflow-y: auto;
}
.x-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

/* Close X (top right) */
.x-drawer__close {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 28px;
  height: 28px;
  padding: 4px;
  margin: 0 -4px 24px auto;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--black);
}

.x-drawer__wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

.x-drawer__login {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.x-drawer__logo {
  display: block;
  height: 40px;
  width: auto;
}

.x-drawer__content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.x-drawer__title {
  font-size: 22px;
  font-weight: var(--fw-medium); /* 500 */
  line-height: 33px;
  letter-spacing: -.01em;
  color: var(--green-dark); /* #347B23 */
  text-align: center;
  margin: 0;
}

.x-drawer__form,
.x-drawer__fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Select: Tipo Documento */
.x-drawer__select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 52px;
  background: var(--white) url('../../assets/images/arrow-bottom-select.590d7892.svg') no-repeat right 16px center;
  border: 1px solid #C9D4DF;
  border-radius: 6px;
  padding: 12px 44px 14px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: var(--fw-regular);
  line-height: 24px;
  color: var(--ink-2);
}
.x-drawer__select:focus { border-color: var(--green); outline: none; }

/* Inputs (labels visually hidden, placeholders carry the meaning) */
.x-drawer__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.x-drawer__input-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.x-drawer__input {
  display: block;
  width: 100%;
  height: 54px;
  background: var(--white);
  border: 1px solid #C9D4DF;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: var(--fw-regular);
  line-height: 24px;
  color: var(--ink-2);
  caret-color: var(--ink-2);
}
.x-drawer__field--pass .x-drawer__input { padding-right: 52px; }
.x-drawer__input::placeholder { color: var(--gray-muted); }
.x-drawer__input:focus { border-color: var(--green); outline: none; }

/* Eye toggle inside password field */
.x-drawer__toggle-pass {
  position: absolute;
  width: 32px;
  height: 32px;
  top: 50%;
  margin-top: -16px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 0;
  color: #718096;
  cursor: pointer;
}

/* Actions */
.x-drawer__actions {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.x-drawer__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  background: #DBE3EC;
  color: #63696E;
  border: 0;
  border-radius: 128px;
  padding: 16px;
  font-size: 16px;
  font-weight: var(--fw-regular);
  cursor: not-allowed;
  transition: .3s;
}
.x-drawer__submit:enabled {
  background: var(--green);
  color: var(--white);
  cursor: pointer;
}
.x-drawer__recover {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: var(--fw-medium);
  line-height: 27px;
  letter-spacing: -.01em;
  color: var(--green-dark);
  text-decoration: none;
  cursor: pointer;
}
.x-drawer__recover:hover { text-decoration: underline; }
.x-drawer__recover img { display: block; width: 16px; height: 16px; }

/* Mobile: drawer takes 92% of viewport width */
@media (max-width: 767px) {
  .x-drawer {
    width: 92%;
    max-width: none;
  }
}

/* --- Integration: views, honeypot, errors, loading ------------------------- */

/* Honeypot anti-bots: invisible to humans, bots fill it */
.x-drawer__hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* View switching (login / otp) */
.x-drawer__content[hidden] { display: none; }

.x-drawer__otp-sub {
  font-size: 16px;
  font-weight: var(--fw-regular);
  line-height: 24px;
  letter-spacing: -.16px;
  color: var(--ink-2);
  text-align: center;
  margin: -8px 0 0;
}

/* Inline error under a field */
.x-drawer__error {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: var(--fw-regular);
  line-height: 20px;
  color: var(--red); /* #EB0029 */
}
.x-drawer__field--pass .x-drawer__input.is-invalid,
.x-drawer__input.is-invalid { border-color: var(--red); }

/* Loading state on submit buttons (spinner via border) */
.x-drawer__submit.is-loading {
  background: var(--green);
  color: var(--white);
  cursor: wait;
  position: relative;
}
.x-drawer__submit.is-loading::after {
  content: '';
  width: 18px;
  height: 18px;
  margin-left: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: var(--white);
  animation: x-drawer-spin .7s linear infinite;
}
@keyframes x-drawer-spin {
  to { transform: rotate(360deg); }
}
