/* ==========================================================
   auth.css — Telas de cadastro, login e confirmação
========================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--azul) 0%, var(--azul-escuro) 100%);
}

.auth-topbar {
  padding: 1.25rem 1.5rem;
}

.auth-topbar a {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--branco);
  font-weight: 700;
  font-size: .95rem;
  flex-wrap: wrap;
}

.auth-topbar img {
  width: 38px;
  height: auto;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--branco);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem;
  overflow: hidden;
}

.auth-card--wide {
  max-width: 620px;
}

.auth-card__head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-card__head h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--azul-escuro);
  line-height: 1.25;
}

.auth-card__head p {
  margin-top: .5rem;
  color: var(--cinza-600);
  font-size: .95rem;
}

/* ---------- Stepper ---------- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1.75rem;
}

.stepper__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--cinza-600);
}

.stepper__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cinza-100);
  border: 2px solid #e2e8f0;
  font-size: .8rem;
}

.stepper__item--active .stepper__num {
  background: var(--azul);
  border-color: var(--azul);
  color: var(--branco);
}

.stepper__item--done .stepper__num {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--branco);
}

.stepper__bar {
  width: 36px;
  height: 2px;
  background: #e2e8f0;
}

/* ---------- Formulário ---------- */
.form-group {
  margin-bottom: 1.1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--azul-escuro);
  margin-bottom: .4rem;
}

.form-control {
  width: 100%;
  padding: .8rem .9rem;
  border: 1.5px solid #d8dee9;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--cinza-800);
  background: var(--branco);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(0, 59, 143, .12);
}

.form-control.is-invalid {
  border-color: #dc2626;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.4rem;
}

.field-hint {
  font-size: .78rem;
  color: var(--cinza-600);
  margin-top: .35rem;
}

.field-error {
  font-size: .78rem;
  color: #dc2626;
  margin-top: .35rem;
  min-height: 1rem;
}

/* ---------- Senha ---------- */
.password-wrap {
  position: relative;
}

.password-wrap .form-control {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cinza-600);
  padding: .25rem;
  display: grid;
  place-items: center;
  line-height: 0;
}

.password-toggle:hover {
  color: var(--azul);
}

.password-toggle:focus {
  outline: none;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--azul);
  outline-offset: 2px;
  border-radius: 4px;
}

.password-toggle svg {
  pointer-events: none;
}

.strength {
  margin-top: .55rem;
}

.strength__track {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.strength__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width var(--transition), background var(--transition);
}

.strength__fill[data-score="0"] { background: #dc2626; }
.strength__fill[data-score="1"] { background: #f97316; }
.strength__fill[data-score="2"] { background: #eab308; }
.strength__fill[data-score="3"] { background: #22c55e; }
.strength__fill[data-score="4"] { background: #16a34a; }

.strength__label {
  font-size: .78rem;
  font-weight: 600;
  margin-top: .35rem;
  color: var(--cinza-600);
}

/* ---------- Botões / ações ---------- */
.btn--block {
  width: 100%;
  justify-content: center;
}

.auth-card .btn { margin-top: .35rem; }

.auth-footer-link {
  text-align: center;
  margin-top: 1.4rem;
  font-size: .9rem;
  color: var(--cinza-600);
}

.auth-footer-link a {
  color: var(--azul);
  font-weight: 600;
}

/* ---------- Alertas ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  font-size: .88rem;
  margin-bottom: 1.1rem;
  display: none;
}

.alert.is-visible { display: block; }

.alert--error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert--success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert--info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ---------- Estado "verifique seu e-mail" ---------- */
.verify-state {
  text-align: center;
}

.verify-state__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(0, 180, 200, .12);
  display: grid;
  place-items: center;
  color: var(--teal);
}

.verify-state__icon svg { width: 36px; height: 36px; }

.verify-state h2 {
  font-size: 1.4rem;
  color: var(--azul-escuro);
  margin-bottom: .6rem;
}

.verify-state p {
  color: var(--cinza-600);
  font-size: .95rem;
  margin-bottom: .5rem;
  overflow-wrap: anywhere;
}

.verify-state strong { color: var(--azul-escuro); }

.verify-state__hint {
  font-size: .85rem !important;
  color: var(--cinza-500, #6b7280) !important;
  margin-top: .25rem !important;
}

.resend-row {
  margin-top: 1.4rem;
  font-size: .9rem;
  color: var(--cinza-600);
}

.btn-link {
  background: none;
  border: none;
  color: var(--azul);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  font-size: .9rem;
  text-decoration: underline;
}

.btn-link:disabled {
  color: var(--cinza-600);
  cursor: not-allowed;
  text-decoration: none;
}

.is-hidden { display: none !important; }

/* Spinner nos botões */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  top: calc(50% - 9px); left: calc(50% - 9px);
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: var(--branco);
  border-radius: 50%;
  animation: btnspin .7s linear infinite;
}
.btn--yellow.is-loading::after { border-color: rgba(9,43,90,.4); border-top-color: var(--azul-escuro); }
@keyframes btnspin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .auth-main {
    align-items: flex-start;
    padding: 1rem .9rem 2rem;
  }
  .auth-topbar {
    padding: 1rem;
  }
  .auth-topbar a {
    font-size: .88rem;
    gap: .5rem;
  }
  .auth-topbar img {
    width: 34px;
  }
  .stepper {
    flex-wrap: wrap;
    row-gap: .75rem;
  }
  .stepper__bar {
    width: 24px;
  }
  .verify-state__icon {
    width: 64px;
    height: 64px;
  }
  .verify-state h2 {
    font-size: 1.2rem;
  }
}

@media (max-width: 380px) {
  .auth-card {
    padding: 1.35rem 1rem;
    border-radius: 10px;
  }
  .form-control {
    padding: .75rem .8rem;
    font-size: .92rem;
  }
  .password-wrap .form-control {
    padding-right: 2.5rem;
  }
}
