/* ============================================================
   BuscadorDeCoches.net — CSS Autenticación
   Archivo: /css/auth.css
   Cubre: login, registro, recuperar contraseña
============================================================ */

/* ── LAYOUT ── */

.page-auth {
  background: var(--g50);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.auth-wrap--wide {
  max-width: 500px;
}

/* ── LOGO ── */

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--black);
  text-decoration: none;
}

.auth-logo strong { color: var(--red); }

.auth-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--red);
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ── CARD ── */

.auth-card {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.auth-card-header {
  margin-bottom: 24px;
  text-align: center;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--black);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--g500);
}

/* ── ERROR ── */

.auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(227,6,19,.06);
  border: 1px solid rgba(227,6,19,.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--red);
  margin-bottom: 18px;
  line-height: 1.45;
}

.auth-error a {
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
}

/* ── FORMULARIO ── */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.auth-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--g600);
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-forgot {
  font-size: 0.775rem;
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
}

.auth-forgot:hover { text-decoration: underline; }

.auth-input {
  height: 44px;
  border: 1.5px solid var(--g200);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 0.9375rem;
  color: var(--black);
  background: var(--g50);
  font-family: var(--font);
  outline: none;
  width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.auth-input:focus {
  border-color: var(--red);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(245,130,31,.1);
}

.auth-input--error {
  border-color: var(--red);
  background: rgba(227,6,19,.03);
}

.auth-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%239499aa' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) center;
  background-size: 12px;
  padding-right: 32px;
  cursor: pointer;
}

/* Input con botón de ojo */
.auth-input-wrap {
  position: relative;
}

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

.auth-toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--g400);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color .15s;
}

.auth-toggle-pass:hover { color: var(--black); }

.auth-field-error {
  font-size: 0.75rem;
  color: var(--red);
  font-weight: 600;
}

.auth-field-hint {
  font-size: 0.725rem;
  color: var(--g400);
}

/* Recordar sesión */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8375rem;
  color: var(--g600);
  cursor: pointer;
}

.auth-remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--red);
  flex-shrink: 0;
}

/* Términos */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.8125rem;
  color: var(--g600);
  cursor: pointer;
  line-height: 1.5;
}

.auth-terms input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--red);
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-terms a {
  color: var(--red);
  text-decoration: underline;
}

.auth-terms--error { color: var(--red); }

/* Fortaleza de contraseña */
.password-strength {
  height: 4px;
  background: var(--g100);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

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

.strength-label {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 3px;
  display: block;
}

/* ── BOTÓN DE SUBMIT ── */

.auth-submit {
  height: 48px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background .15s, transform .1s;
  font-family: var(--font);
  letter-spacing: 0.2px;
}

.auth-submit:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.auth-submit:active { transform: translateY(0); }

.auth-submit--register {
  background: var(--green);
}

.auth-submit--register:hover {
  background: #076030;
}

/* ── DIVISOR ── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--g400);
  font-size: 0.775rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--g200);
}

/* ── BOTÓN DE REGISTRO (alternativa) ── */

.auth-register-btn {
  display: block;
  width: 100%;
  height: 44px;
  line-height: 44px;
  text-align: center;
  border: 1.5px solid var(--g200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--g600);
  text-decoration: none;
  transition: border-color .15s, color .15s;
  background: var(--white);
}

.auth-register-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ── BENEFICIOS (registro) ── */

.register-benefits {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(245,130,31,.06);
  border: 1px solid rgba(245,130,31,.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
}

.benefit-item {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--red);
}

/* ── DEMO BOX (solo desarrollo) ── */

.auth-demo {
  background: rgba(17,85,204,.06);
  border: 1px solid rgba(17,85,204,.18);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.775rem;
  color: var(--blue);
  line-height: 1.7;
  width: 100%;
  text-align: center;
}

.auth-demo p { margin: 0; }

/* ── FOOTER ── */

.auth-footer {
  font-size: 0.775rem;
  color: var(--g400);
  text-align: center;
}

.auth-footer a {
  color: var(--g500);
  text-decoration: none;
}

.auth-footer a:hover { color: var(--red); }

/* ── RESPONSIVE ── */

@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
  .auth-form-grid { grid-template-columns: 1fr; }
  .auth-title { font-size: 1.15rem; }
}
