/*
 * CSS: Afiliado Auth — Login & Cadastro
 * Compartilhado entre page-login.php e page-register.php
 * Enfileirado via wp_enqueue_scripts (functions.php — seção 2)
 */

/* ── Reset base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.afiliado-dashboard {
  font-family: 'DM Sans', sans-serif;
  background: #f5f5f7;
  color: #071C31;
  min-height: 100vh;
}

/* ── Layout de página auth ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: #f5f5f7;
}

.auth-card {
  background: #fff;
  border: 1px solid #e8e8ee;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* ── Logo ── */
.auth-logo {
  text-align: center;
  margin-bottom: 15px;
}

.auth-logo span {
  font-size: 22px;
  font-weight: 700;
  color: #E7454A;
  letter-spacing: -0.5px;
}

.auth-logo-img {
  width: 180px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ── Cabeçalho ── */
.auth-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: #071C31;
  margin-bottom: 6px;
  text-align: center;
}

.auth-subtitle {
  font-size: 14px;
  color: #6b6b8a;
  text-align: center;
  margin-bottom: 28px;
}

/* ── Campos ── */
.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #071C31;
  margin-bottom: 6px;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid #e8e8ee;
  background: #fafafa;
  color: #071C31;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  border-color: #E7454A;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(231, 69, 74, 0.08);
}

/* ── Botão submit ── */
.auth-card input[type="submit"],
.auth-submit-btn {
  width: 100%;
  background: #E7454A;
  color: #fff;
  border: none;
  padding: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  margin-top: 6px;
}

.auth-card input[type="submit"]:hover,
.auth-submit-btn:hover {
  background: #c93539;
}

.auth-card input[type="submit"]:active {
  transform: scale(0.98);
}

/* ── Cloudflare Turnstile ── */
.cf-turnstile {
  width: 100% !important;
}
.cf-turnstile iframe {
  width: 100% !important;
}

/* ── Mensagens de erro/sucesso ── */
.auth-error {
  background: #fff1f1;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #16a34a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Link de rodapé ── */
.auth-footer-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #6b6b8a;
}

.auth-footer-link a {
  color: #E7454A;
  font-weight: 600;
  text-decoration: none;
}

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

/* ── wp_login_form() Overrides ── */
#loginform p {
  margin-bottom: 0;
}

#loginform label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #071C31;
  margin-bottom: 6px;
}

#loginform input[type="text"],
#loginform input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid #e8e8ee;
  background: #fafafa;
  color: #071C31;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus {
  border-color: #E7454A;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(231, 69, 74, 0.08);
}

#loginform .forgetmenot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b6b8a;
  margin-bottom: 16px;
}

#loginform input[type="submit"] {
  width: 100%;
  background: #E7454A;
  color: #fff;
  border: none;
  padding: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: background 0.2s;
}

#loginform input[type="submit"]:hover {
  background: #c93539;
}

/* ── Divisor (usado no cadastro) ── */
.auth-divider {
  height: 1px;
  background: #f0f0f6;
  margin: 8px 0 20px;
}

/* Alinhamento correto do olho dentro do #loginform (wp_login_form nativo) */
#loginform .pass-field-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 0;
}

#loginform .pass-field-wrap input[type="password"],
#loginform .pass-field-wrap input[type="text"] {
  padding-right: 44px;
  margin-bottom: 16px;
}

#loginform .pass-toggle {
  top: 38%;
}

/* ── Dica de senha ── */
.password-hint {
  font-size: 12px;
  color: #6b6b8a;
  margin-top: -10px;
  margin-bottom: 16px;
}

/* ── Campo de senha com olho ── */
.pass-field-wrap {
  position: relative;
  margin-bottom: 8px;
}

.pass-field-wrap input[type="password"],
.pass-field-wrap input[type="text"] {
  width: 100%;
  padding: 10px 44px 10px 14px;
  margin-bottom: 0;
  border-radius: 8px;
  border: 1px solid #e8e8ee;
  background: #fafafa;
  color: #071C31;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pass-field-wrap input:focus {
  border-color: #E7454A;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(231, 69, 74, 0.08);
}

.pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.pass-toggle:hover {
  color: #E7454A;
}

/* ── Barra de força de senha ── */
.strength-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: #e8e8ee;
  border-radius: 99px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.3s ease, background 0.3s ease;
}

.strength-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 72px;
  text-align: right;
}

/* ── Responsivo ── */
@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 12px;
  }

  .auth-card h2 {
    font-size: 18px;
  }

  .auth-logo span {
    font-size: 20px;
  }

  /* Evita zoom automático no iOS (font-size < 16px dispara zoom) */
  .auth-card input[type="text"],
  .auth-card input[type="email"],
  .auth-card input[type="password"],
  #loginform input[type="text"],
  #loginform input[type="password"] {
    font-size: 16px;
  }

  .auth-card input[type="submit"],
  #loginform input[type="submit"] {
    padding: 14px;
    font-size: 15px;
  }
}