/* ============================================================
   OnCherry · auth.css
   Estilos de login / crear org / aceptar invitación.
   Usa los mismos tokens (:root) definidos en styles.css.
   Cargar DESPUÉS de styles.css en el index.html.
   ============================================================ */

/* Utilidad genérica para mostrar/ocultar contenedores */
.hidden { display: none !important; }

/* Pantalla de auth a pantalla completa */
.auth-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 18px 60px;
  z-index: 50;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 24px 26px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-brand img { height: 44px; width: auto; }

.auth-brand h1 {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.auth-view-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-view-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.auth-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-input, .auth-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.auth-input:focus, .auth-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.auth-actions { margin-top: 18px; }

.auth-links {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

.auth-info-box {
  background: var(--primary-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.4;
}

.auth-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-style: italic;
}

/* Fila token + botón "ver invitación" */
.invite-token-row { display: flex; gap: 8px; align-items: flex-end; }
.invite-token-row .auth-field { flex: 1; margin-bottom: 0; }
.invite-token-row .btn-ghost { width: auto; white-space: nowrap; padding: 12px 14px; }

/* =========== Chip de usuario en el Home =========== */
.user-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 18px;
}

.user-strip-info { min-width: 0; }
.user-strip-name { font-weight: 600; font-size: 14px; color: var(--text); }
.user-strip-org  { font-size: 12px; color: var(--text-muted); }

.user-strip-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ============================================================
   Muro de prueba (Paso 8.5): pista de RUT, banner de estado
   y cuadro de pago. Usa los mismos tokens :root de styles.css.
   ============================================================ */

/* Pista de validación bajo el input de RUT */
.auth-hint { font-size: 12px; min-height: 14px; margin-top: -4px; color: var(--text-muted); }
.auth-hint.ok  { color: var(--primary); }
.auth-hint.bad { color: var(--accent); }

/* Banner de estado de la cuenta, arriba de las vistas */
.trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.3;
}
.trial-banner.is-trial {
  background: var(--primary-tint);
  color: var(--text);
  border: 1px solid var(--border);
}
.trial-banner.is-blocked {
  background: var(--accent);
  color: #fff;
}
.trial-banner-text { flex: 1; min-width: 0; }
.trial-banner-btn {
  flex-shrink: 0;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}

/* Cuadro de pago (reusa .modal / .modal-content de styles.css) */
.pay-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 4px 12px;
  margin: 14px 0;
}
.pay-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.pay-row:last-child { border-bottom: none; }
.pay-row .pay-k { color: var(--text-muted); }
.pay-row .pay-v { font-weight: 600; color: var(--text); text-align: right; }
.pay-row-total .pay-v { color: var(--accent); }
.pay-note { font-size: 13px; color: var(--text-muted); margin: 8px 0 0; line-height: 1.4; }
