/*
 * Login / cadastro central — padrão Binisoft (auth hub).
 *
 * VARIÁVEL por app (definir em :root do site): --bg, --bg-spot, --surface, --input-bg,
 * --text, --muted, --accent, --danger, --radius, --font, --btn-primary-bg; logo no header.
 *
 * FIXO neste arquivo: dimensões do hub, OTP, feedback ✓/✕, popover ?, links, tentativas.
 */
.auth-hub {
  max-width: 20rem;
  margin: 0 auto;
  padding: 1.25rem 1.1rem 1rem;
}

.auth-hub__title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.auth-hub__email-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  word-break: break-word;
}

.auth-hub__sub {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.auth-hub__sender {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}

.auth-hub__sender-text {
  margin: 0;
}

.auth-hub__code-wrap {
  margin: 0.25rem 0 0.5rem;
}

.auth-hub__code-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.auth-hub__code-field {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.auth-hub__feedback {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  pointer-events: none;
}

.auth-hub__feedback[hidden] {
  display: none !important;
}

.auth-hub__feedback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 800;
  opacity: 0;
  transform: scale(0.6);
  animation: auth-hub-pop 0.45s ease forwards;
}

.auth-hub__feedback--ok .auth-hub__feedback-icon {
  background: rgba(34, 197, 94, 0.2);
  border: 2px solid #22c55e;
  color: #4ade80;
}

.auth-hub__feedback--ok .auth-hub__feedback-icon::before {
  content: "✓";
}

.auth-hub__feedback--err .auth-hub__feedback-icon {
  background: rgba(244, 113, 116, 0.18);
  border: 2px solid var(--danger);
  color: #fca5a5;
}

.auth-hub__feedback--err .auth-hub__feedback-icon::before {
  content: "✕";
}

@keyframes auth-hub-pop {
  0% { opacity: 0; transform: scale(0.55); }
  70% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.auth-hub__code-input--shake {
  animation: auth-hub-shake 0.42s ease;
}

@keyframes auth-hub-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.auth-hub__code-wrap .field {
  margin-top: 0;
}

.auth-hub__code-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: clamp(2rem, 10vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-align: center;
  text-transform: uppercase;
  padding: 0.85rem 0.5rem;
  min-height: 3.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
}

.auth-hub__code-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: transparent;
}

.auth-hub__code-input::placeholder {
  letter-spacing: 0.2em;
  color: rgba(139, 156, 179, 0.45);
  font-weight: 600;
}

.auth-hub__attempts {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: var(--danger);
  text-align: center;
}

.auth-hub__error {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #ffc9cb;
  background: rgba(244, 113, 116, 0.12);
  border: 1px solid rgba(244, 113, 116, 0.35);
  text-align: center;
}

.auth-hub__flash {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  color: #dce9ff;
  background: rgba(61, 139, 253, 0.15);
  border: 1px solid rgba(61, 139, 253, 0.35);
}

.auth-hub__btn {
  width: 100%;
  margin-top: 0.75rem;
}

.auth-hub__btn--resend {
  margin-top: 0.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  font-weight: 600;
}

.auth-hub__btn--resend:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-hub__links {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.auth-hub__links a {
  color: var(--accent);
  text-decoration: none;
}

.auth-hub__links a:hover {
  text-decoration: underline;
}

.auth-hub__links .sep {
  color: var(--muted);
  user-select: none;
}

.auth-hub__help-btn {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1px solid rgba(61, 139, 253, 0.55);
  background: rgba(61, 139, 253, 0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.auth-hub__help-btn[aria-expanded="true"] {
  background: var(--accent);
  color: #fff;
}

.auth-hub__popover {
  margin: -0.35rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

.auth-hub__popover[hidden] {
  display: none !important;
}

.auth-hub__popover p {
  margin: 0 0 0.5rem;
}

.auth-hub__popover-close {
  font-size: 0.8rem;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.auth-hub .auth-form .field label {
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.auth-hub--register {
  max-width: 21rem;
}
