/* Popup de Ingresar / Registro (visitantes) */

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  animation: auth-modal-fade 0.18s ease-out;
}

.auth-modal-dialog {
  position: relative;
  width: min(100%, 400px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px 26px 24px;
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: auth-modal-pop 0.2s ease-out;
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--supress-text-color);
  box-shadow: none;
}

.auth-modal-close:hover {
  background: var(--accent-muted);
  color: var(--accent);
  box-shadow: none;
}

.auth-modal-close svg {
  width: 18px;
  height: 18px;
}

.auth-modal-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

.auth-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.auth-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: var(--white-color);
  background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent) 50%, var(--accent-hover) 100%);
  box-shadow: 0 6px 18px var(--accent-glow);
}

.auth-modal-icon svg {
  width: 26px;
  height: 26px;
}

.auth-modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--page-bg);
  border: 1px solid var(--box-border);
  border-radius: var(--radius);
}

.auth-modal-tab {
  height: 36px;
  line-height: normal;
  border: none;
  background: transparent;
  color: var(--supress-text-color);
  box-shadow: none;
}

.auth-modal-tab:hover {
  background: var(--box-bg);
  color: var(--text-color);
  box-shadow: none;
}

.auth-modal-tab.is-active {
  background: var(--box-bg);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

form.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}

form.auth-modal-form[hidden] {
  display: none;
}

.auth-modal-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--supress-text-color);
  text-align: center;
}

.auth-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-modal-field input {
  width: 100%;
}

.auth-pass-wrap {
  position: relative;
}

.auth-modal-field .auth-pass-wrap input {
  padding-right: 44px;
}

.auth-pass-wrap .auth-pass-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: normal;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--supress-text-color);
  box-shadow: none;
  transform: translateY(-50%);
  cursor: pointer;
}

.auth-pass-wrap .auth-pass-toggle:hover,
.auth-pass-wrap .auth-pass-toggle:focus-visible {
  background: var(--accent-muted);
  color: var(--accent);
  box-shadow: none;
}

.auth-pass-wrap .auth-pass-toggle:active {
  transform: translateY(-50%);
}

.auth-pass-toggle svg {
  width: 18px;
  height: 18px;
}

.auth-pass-toggle .auth-pass-eye-off,
.auth-pass-toggle.is-visible .auth-pass-eye {
  display: none;
}

.auth-pass-toggle.is-visible .auth-pass-eye-off {
  display: block;
}

.auth-modal-submit {
  width: 100%;
  height: 42px;
  margin-top: 4px;
}

.auth-modal-link {
  align-self: center;
  font-size: 0.85rem;
}

.auth-modal-tabs[hidden],
.auth-modal-alert[hidden],
.auth-modal-done[hidden] {
  display: none;
}

.auth-modal-alert {
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius);
}

.auth-modal-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  animation: auth-modal-pop 0.2s ease-out;
}

.auth-modal-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.auth-modal-done-icon svg {
  width: 24px;
  height: 24px;
}

.auth-modal-done h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.auth-modal-done p {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--supress-text-color);
}

@keyframes auth-modal-fade {
  from { opacity: 0; }
}

@keyframes auth-modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}
