/* ============================================================
   ACCESS BAR — Zero Bootstrap, pure CSS
   ============================================================ */

:root {
  --ab-zur-bg: #0058BF;
  --ab-qr-bg: linear-gradient(to top, #870911 10%, #ed2d38);
  --ab-height: 7.55rem;
  --ab-height-mobile: 4.86rem;
  --ab-radius-expanded: 20px;
  --ab-transition: 0.3s ease;
  --ab-otp-size: 2.5rem;
  --ab-otp-size-mobile: 2.25rem;
  --ab-otp-gap: 0.2rem;
  --ab-font-size-sm: 0.8rem;
  --ab-font-size-label: 1.25rem;
  --ab-container: 1140px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Legacy class — used by JS expand/collapse */
.zur-oculto {
  display: none;
}

/* Hide sr-only labels inside cont-input-cav */
.cont-input-cav > label {
  display: none !important;
}

/* ============================================================
   LAYOUT — Full-width bar, two-panel grid
   ============================================================ */

.ab-bar {
  width: 100%;
  min-height: var(--ab-height);
  overflow: visible;
}

/* Two-panel grid — 50/50, full width, no Bootstrap */
.ab-bar__container {
  width: 100%;
  max-width: 100%;
  min-height: var(--ab-height);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: visible;
}

/* Panel base — equal halves, no float, no absolute */
.ab-bar__panel {
  overflow: hidden;
  position: relative;
}

.ab-bar__panel--zur {
  background: var(--ab-zur-bg);
  display: flex;
  justify-content: end;
  align-items: end;
  flex-direction: column;
}

.ab-bar__panel--qr {
  background: var(--ab-qr-bg);
}

/* ============================================================
   ZUR LOGIN PANEL
   ============================================================ */

.ab-bar__form {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 0.75rem;
  max-width: 21.5rem;
  box-sizing: border-box;
  position: relative;
  gap: 1rem;
}

.ab-bar__header {
  display: flex;
  align-items: end;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.ab-bar__brand {
  display: flex;
  align-self: baseline;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  color: #fff;
  font-size: var(--ab-font-size-sm);
  line-height: 1.3;
  white-space: nowrap;
  user-select: none;
  flex: 0 0 auto;
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
  width: 100%;
}

.ab-bar__brand:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 2px;
}

.ab-bar__brand-icon {
  font-size: var(--ab-font-size-label);
  display: flex;
  align-items: center;
}

.ab-bar__brand-text { display: inline; }

.ab-bar__brand-arrow {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  transition: transform var(--ab-transition);
}

.ab-bar__brand[aria-expanded="true"] .ab-bar__brand-arrow {
  transform: rotate(90deg);
}

.ab-bar__email-wrap {
  flex: 1 1 0%;
  display: flex;
  width: 100%;
}

.ab-bar__input {
  width: 100%;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 0.9rem;
  box-sizing: border-box;
  height: auto !important;
}

.ab-bar__input::placeholder { color: #999 !important; -webkit-text-fill-color: #999 !important; }

.ab-bar__input:focus {
  outline: 2px solid var(--themecolor, #3182ce);
  outline-offset: 2px;
  border-color: var(--themecolor, #3182ce);
}

/* Expandable section */
.ab-bar__expandable {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--ab-transition), opacity var(--ab-transition);
  pointer-events: none;
}

.ab-bar__expandable.is-open {
  max-height: 300px;
  opacity: 1;
  pointer-events: auto;
}

.ab-bar__panel--zur.is-expanded {
  height: auto;
  overflow: visible;
}

.ab-bar__password-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: end;
  justify-content: end;
  width: 100%;
}

.ab-bar__password-wrap .ab-bar__input {
  flex: 1;
  width: 100%;
}

.ab-bar__toggle-pw {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.ab-bar__toggle-pw:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 2px;
}

.ab-bar__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.ab-bar__forgot {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--ab-font-size-sm);
  text-decoration: underline;
  cursor: pointer;
}

.ab-bar__forgot:hover,
.ab-bar__forgot:focus { color: #fff; }

.ab-bar__submit {
  background: var(--themecolor, #3182ce);
  color: #fff;
  border: 2px solid var(--themecolor, #3182ce);
  padding: 0.35rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.ab-bar__submit:hover,
.ab-bar__submit:focus-visible {
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.ab-bar__tagline {
  color: #fff;
  font-size: var(--ab-font-size-sm);
  text-align: center;
  line-height: 1.4;
  margin: 0;
}

/* ============================================================
   QR SCANNER PANEL — Pure CSS, no Bootstrap
   ============================================================ */

.ab-bar__qr-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ab-bar__qr-inner {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 1rem 0.75rem;
  box-sizing: border-box;
  gap: 0.5rem;
}

.ab-bar__qr-image {
  flex-shrink: 0;
  width: 60px;
  text-align: center;
}

.ab-bar__qr-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.ab-bar__qr-fields {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.ab-bar__qr-label {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ab-bar__otp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ab-bar__otp {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 20.5rem;
  gap: var(--ab-otp-gap);
}

.ab-bar__otp-input {
  width: 100% !important;
  height: 3rem !important;
  text-align: center;
  padding: 0 !important;
  font-size: 1.25rem;
  font-weight: 700;
  color: #333;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: none !important;
  line-height: normal;
  display: inline-block;
  vertical-align: middle;
  box-sizing: border-box;
}

.ab-bar__otp-input:focus {
  outline: none;
  border-color: var(--themecolor, #3182ce);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.3);
}

.ab-bar__qr-hint {
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ab-bar__qr-arrow {
  font-size: 1.25rem;
  animation: ab-arrow-pulse 1.5s ease-out infinite;
}

@keyframes ab-arrow-pulse {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(-4px); opacity: 0.6; }
}

.ab-bar__qr-submit {
  background: var(--themecolor, #0058BF);
  color: #fff;
  border: 2px solid var(--themecolor, #0058BF);
  padding: 0.25rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  align-self: flex-start;
  white-space: nowrap;
}

.ab-bar__qr-submit:hover {
  background: rgba(0, 0, 0, 0.15);
  border-color: var(--themecolor, #0058BF);
}

.ab-bar__message {
  display: none;
  color: #dc3545;
  font-size: 0.9em;
  margin-top: 0.5rem;
}

.ab-bar__message.is-visible { display: block; }

/* ============================================================
   RESPONSIVE — Mobile first, no Bootstrap
   ============================================================ */
   .ab-bar__form-inner {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

@media (max-width: 640px) {

  .ab-bar__form-inner {
    max-width: 21rem;
    gap: 1rem;
  }

   .ab-bar__qr-fields {
  	display: flex;
  	flex-direction: column;
   	max-width: 21rem;
   }

  .ab-bar { height: auto; }

  .ab-bar__container {
    grid-template-columns: 1fr;
    height: auto;
  }

  .ab-bar__panel {
    width: 100%;
  }

  .ab-bar__panel--zur {
    justify-content: center;
    align-items: stretch;
  }

  .ab-bar__form {
    margin-right: 0;
    padding: 1.5rem 2.5rem;
    max-width: 100%;
    justify-content: center;
    align-items: center;
    display: flex;
  }

  .ab-bar__header {
    align-items: center;
  }

  .ab-bar__email-wrap {
    width: 100%;
    max-width: 100%;
  }

  .ab-bar__input {
    width: 100%;
    max-width: 100%;
  }

  .ab-bar__password-wrap .ab-bar__input {
    max-width: 100% !important;
  }

  .ab-bar__panel--zur.is-expanded {
    width: 100%;
    height: auto;
  }

  .ab-bar__qr-image {
    display: none;
  }

  .ab-bar__actions {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .ab-bar__forgot {
    order: -1;
  }

  .ab-bar__submit {
    width: 100%;
  }

  /* Mobile QR: column layout — button below inputs */
  .ab-bar__qr-inner,
  .ab-bar__qr-inner--mobile {
    flex-direction: column;
    align-items: center;

    padding: 1.5rem 2.5rem;
    gap: 1rem;
  }

  .ab-bar__otp-row {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .ab-bar__otp {
    width: 100%;
    justify-content: space-between;
    max-width: 100%;
  }

  .ab-bar__qr-submit {
    width: 100%;
    text-align: center;
  }

  .ab-bar__qr-fields { align-items: center; }
  .ab-bar__qr-label { text-align: center; }
  .ab-bar__qr-hint { text-align: center; }

  .ab-bar__otp-input {
    height: 4rem !important;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ab-bar__expandable,
  .ab-bar__panel,
  .ab-bar__brand-arrow { transition: none; }
}
